npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

karaoke-captions-react

v0.1.2

Published

Word-by-word highlighted (karaoke) captions for React. Feed it a word-timed caption document and a currentTime, get Same Language Subtitling: the proven reading-practice technique, as a component.

Readme

karaoke-captions-react

Captions that light up word by word as they are spoken, for React and React Native.

MIT. Node 18+, React 18+.

npm install karaoke-captions-react @everyword/captions-core

Why word-by-word

Same Language Subtitling puts karaoke-style captions in the viewer's own language on ordinary entertainment. It has been running on Indian national television for two decades and is national broadcast policy there. A five-year study of 13,000 people who could initially read little or nothing found 32 percentage points more children becoming good readers than in the unexposed group, at about $0.004 per learner.

Amazon ships the same mechanic for books, as Immersion Reading. No video platform ships it. This component is the renderer that is missing.

Use

import { KaraokeCaptions } from "karaoke-captions-react";

<KaraokeCaptions doc={captionDoc} time={video.currentTime} />

doc is a word-timed caption document from @everyword/captions-core, which also normalizes Amazon Transcribe output into that shape. time is seconds, straight off your media element. Drive it from requestAnimationFrame or a timeupdate handler; the lookup is a binary search over a prebuilt index and allocates nothing per frame.

Theming

Four CSS variables, so it inherits your design rather than imposing one.

.captions {
  --kc-highlight: #ffd34d;      /* background behind the word being spoken */
  --kc-highlight-ink: #21242b;  /* that word's text colour */
  --kc-done-ink: inherit;       /* words already spoken */
  --kc-upcoming-ink: inherit;   /* words not yet spoken, also dimmed to 0.55 */
}

Pass your own class with className. Nothing else is styled for you.

Words carry data-state="done" | "active" | "upcoming", so you can target them directly if the variables are not enough.

React Native and Fire TV

import { KaraokeCaptionsNative } from "karaoke-captions-react/native";

The native entry ships as TypeScript source rather than compiled JavaScript, because it imports react-native and is built by your own Metro transform. Every React Native project already does that transform, so no configuration is needed. react-native is an optional peer dependency: install it only if you use this entry.

Same component, same document. React Native has no CSS variables, so colours are props instead:

<KaraokeCaptionsNative
  doc={doc}
  time={position}
  style={styles.captionBox}
  textStyle={styles.captionText}
  highlightColor="#ffd34d"
  highlightInk="#21242b"
/>

It runs on a Fire TV in a ten-foot layout.

Never early

The rule the renderer enforces: a word may light late, never early. A highlight that runs ahead of the voice teaches a learning reader that a sound belongs to the next word, which is worse than no highlight at all.

Measured end to end against gold Montreal Forced Aligner alignments on LibriSpeech, on the clean split and again on the split the corpus itself labels hard: 30 ms median onset error on both, and zero words lit early beyond 150 ms across 766 and 761 matched words respectively. Method and reproduction in EVAL.md.

API

  • <KaraokeCaptions doc time className? onWordsRead? /> the web renderer
  • <KaraokeCaptionsNative doc time style? textStyle? highlightColor? highlightInk? doneInk? upcomingInk? onWordsRead? /> from karaoke-captions-react/native
  • useWordIndex(doc, time): WordIndex the memoised cursor lookup, if you want to drive something else with it
  • globalWordPosition(doc, wordIndex): number how many words have been read at that cursor position

onWordsRead(count) fires when the highlight advances, with the number of words completed since the last call. Seeking backward never emits a negative count. It is what drives a reading-exposure meter.

License

MIT.