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

voice-flow-x

v0.0.0

Published

A voice stream processing framework unrelated to the environment

Readme

voice-flow-x

npm version npm downloads bundle JSDocs License

🎙️ Environment-agnostic voice stream processing — a small, testable API for consuming audio chunks → async ASR text streams, merging segments, debouncing deltas, and matching commands.

  • 🌊 Streaming-firstVoice consumes incremental recognition as AsyncIterable / ReadableStream, handles segment switches and candidate merging
  • 🎯 UI-friendly — dedupes snapshots, short-window throttling, and a recent-output window to tame ASR flicker
  • 🧩 Pluggable commands — match on delta / final with strings, predicates, or regex; stop, clear, and custom handler
  • 📘 TypeScript-native — generic Chunk<T> and VoiceOptions<T> for any audio payload type

📌 Note This library is only a stream + text state machine. It does not ship recording, WebSocket, or a specific ASR SDK — wire stream to your service.

📦 Install

pnpm add voice-flow-x
npm install voice-flow-x

🚀 Usage

Minimal example

Use createVoice (or new Voice) and provide stream: for each Chunk, return the async text stream for that audio segment.

import { createVoice } from 'voice-flow-x'

const voice = createVoice({
  stream: async ({ data, id }) => {
    // Your ASR: return AsyncIterable<string> or ReadableStream<string>
    return yourAsrStream(data, id)
  },
  onDelta: (text) => {
    // Debounced full snapshot (good for the current recognition line)
  },
  onFinal: (text) => {
    // Fires when `done()` completes (e.g. silence timeout with `finalIdleMs`, or manual `done()`)
  },
  deltaIdleMs: 50, // debounce for onDelta, default 50
  finalIdleMs: 2000, // optional: silence window before auto-finalize when no new chunk
  debug: false,
})

// After you get audio from the mic or elsewhere:
voice.feed({ data: audioPayload, id: segmentId })

Commands

Register match-and-run rules on streaming text — handy for keyword interrupts or clearing the UI.

voice.addCommand({
  match: ['stop', 'cancel'],
  stage: 'delta',
  stop: true, // skip further onDelta/onFinal handling when matched
  clear: true, // pass empty string to callbacks to clear the view
  handler: (text) => { /* side effects */ },
})

match may be string[] (includes), (text: string) => boolean, or RegExp.

State & concurrency

  • feed(chunk) — queued processing; continues with the next chunk when the current run finishes
  • lock(ms) / unlock() — pause processing; auto-unlock after timeout; unlock clears internal text state
  • finalize() — when finalIdleMs is set, schedules done() after silence (no new audio)
  • clear() — resets prefix, merged text, and dedupe window (often via internal or onClear paths)

Types

Exporting from voice-flow-x: Voice, createVoice, Chunk, Command, VoiceOptions, AsyncIterableStream, and more — see JSDocs.

🔧 For package maintainers

If you use npm Trusted Publisher, run pnpm publish once locally to create the package and link the GitHub repo on npm; later, pnpm run release can drive releases via CI. See npm docs and scripts in this repo.

📄 License

MIT License © Hairyf