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

@enumura/glyphflow

v1.0.0

Published

Browser Web Speech narration with smoothly wiping inside-glyph captions.

Readme

GlyphFlow

A browser library that speaks English text with Web Speech API while smoothly wiping each caption word from left to right.

Demo media placeholder — add a GIF or screenshot here before publishing.

Features

  • Uses only the browser's speechSynthesis; no audio files, network, storage, or AI models.
  • Wipes inside each word with CSS gradients rather than flipping whole-word colors.
  • Learns timing from observed word boundaries during a narration session.
  • Includes short punctuation and line-break pauses in its initial estimates.
  • Plain TypeScript DOM API: no React or Vue dependency, and SSR-safe imports.

Install

npm install @enumura/glyphflow
import { createKaraokeNarrator } from "@enumura/glyphflow";
import "@enumura/glyphflow/styles.css";

const narrator = createKaraokeNarrator({
  text: "This is a karaoke caption.",
  target: document.querySelector("#caption")!,
  rate: 1,
});
narrator.speak();

Call pause(), resume(), cancel(), getDiagnostics(), or destroy() on the returned narrator. Calling speak() again cancels and replaces the active session.

CSS customization

The library only sets --kn-progress inline. Override its appearance normally:

.kn-word {
  --kn-highlight-color: #fff3b0;
  --kn-unhighlight-color: #736a55;
  font-family: Georgia, serif;
}

States and events

onStateChange receives idle, starting, speaking, paused, ended, cancelled, error, or unsupported. starting means the browser has not confirmed playback; a voice that does not start within 10 seconds reports error. unsupported includes missing Web Speech support and voices that finish without usable word-boundary events. onWordTiming receives measured timing samples and current diagnostics. Use getSpeechSynthesisSupport() before creating UI; getVoices() safely returns an empty list until the browser populates voices (listen for voiceschanged in application UI).

Timing samples require two consecutive word boundaries. The final word therefore has no measured sample; it is completed when speech ends. A skipped boundary also produces no sample for that interval. If a following boundary is late or missing, the visual wipe advances to the next word after a bounded prediction delay; this fallback never creates a measured timing sample.

Browser support

The supported starting point is Chrome Desktop, English text, and a voice that emits word boundary events. Web Speech API behavior varies by browser, OS, installed voice, and language. Real voice output cannot be established by the automated tests.

To verify a voice manually, run npm run demo in Chrome Desktop, select an English voice, and:

  1. Play the default sentence at rate 1.0. Confirm the highlight moves through the inside of each character. Normal word boundaries complete the prior word; a late or missing boundary uses the visual fallback described above.
  2. Pause mid-word, wait, then resume. Confirm the wipe stays still during the pause and does not jump after resume.
  3. Try go go go, punctuation, multiple spaces, and a line break. Confirm repeated words track separately and spacing is preserved.
  4. Speak again while audio is active, then cancel. Confirm callbacks from the first session do not change the new display.
  5. Check the status line and timing table. A voice that provides no usable word boundaries should report unsupported after playback ends.

The initial Chrome voice and OS combination has not yet been verified in this repository. Record the voice name, OS, browser version, and observations before claiming a compatibility result.

Limitations

This is not an audio-file synchronization or forced-alignment library. It cannot make a voice more natural; voice quality is determined by the browser, OS, and voice. It needs word boundaries, does not guarantee every OS/voice, and deliberately performs no storage, analytics, network request, or external-model use. Voice-specific persistence or analysis belongs to the host application.

The browser exposes one shared speechSynthesis queue. Cancelling an active GlyphFlow narration uses the global speechSynthesis.cancel() method and can also stop speech started by other code on the page. Coordinate speech ownership in the host application.

Development

npm install
npm run lint
npm run format:check
npm test
npm run build
npm run demo

The contributor documentation site lives in docs-site/. Run npm run docs:install once, then npm run docs:dev for English or npm run docs:dev:ja for Japanese. Docusaurus serves one locale at a time in development; npm run docs:build builds both.

Contributing

See CONTRIBUTING.md for development commands, pull request expectations, and the information to include in a bug report.

License

MIT