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

@sherpaw/xsai-transcription

v0.0.2

Published

Streaming transcription wrapper for Sherpa-ONNX WASM with xsai-style ergonomics

Readme

@sherpaw/xsai-transcription

xsai-style streaming transcription provider for Sherpa-ONNX WASM.

This package now follows a provider/executor design similar to xsai-transformers:

  • provider: createSherpawProvider().speech(...)
  • execution: streamTranscription({ ...providerResult })

Structure

  • src/stream-transcription/core.ts
    • low-level module/session helpers (initTranscriptionModule, createSession, etc.)
  • src/stream-transcription/provider.ts
    • createSherpawProvider
    • implements fetch-override RPC adapter
  • src/stream-transcription/execute.ts
    • streamTranscription(...) final API executor
  • src/stream-transcription/session.ts
    • runtime streaming session built on @sherpaw/asr
  • src/stream-transcription/events.ts
    • event communication via @moeru/eventa

Main API (xsai-style)

import {
  asRemoteUrl,
  createSherpawProvider,
  streamTranscription,
} from '@sherpaw/xsai-transcription'
import transcriptionWorkerURL from '@sherpaw/xsai-transcription/worker?worker&url'

const sherpawProvider = createSherpawProvider({
  workerURL: transcriptionWorkerURL,
})

const speech = sherpawProvider.speech({
  metadata: asRemoteUrl('https://huggingface.co/.../tokens.json'),
  data: asRemoteUrl('https://huggingface.co/.../model.int8.onnx.data'),
  sampleRate: 16000,
})

await speech.loadSpeech()

const transcription = streamTranscription({ ...speech })
const writer = transcription.input.getWriter()
await writer.write(float32Chunk)
await writer.close()
const final = await transcription.done

const sentenceReader = transcription.streams.sentences.getReader()
const { value: sentence } = await sentenceReader.read()
console.log('sentence:', sentence?.text)

Provider design

createSherpawProvider() returns:

  • speech(model) -> { baseURL, fetch, loadSpeech, terminateSpeech }
  • speech(model) exposes openStream(...) for native bi-directional command/event streaming.

streamTranscription now uses the duplex stream transport (openStream) as the primary execution path.

loadSpeech() is optional preloading for model assets before streaming starts. terminateSpeech() terminates provider-owned worker state for the speech transport instance.

Use asRemoteUrl(...) when model assets should be fetched on the main thread before being transferred into the worker.

Event model

Events emitted in streamTranscription(...).streams.full:

  • transcription.started
  • sentence.begin
  • transcription.partial
  • word
  • sentence.end
  • transcription.completed

These are routed with @moeru/eventa internally.

streamTranscription(...).streams also exposes typed stream branches:

  • full: all events (TranscriptionEvent)
  • partials: only transcription.partial
  • words: only word
  • sentences: only sentence.end

Low-level APIs

You can still use lower-level primitives directly:

  • initTranscriptionModule()
  • loadModelFiles(module, { metadata, data })
  • createStreamingTranscriptionSession(...)
  • createSession(module, options)
  • transcribeOnce(...)
  • pcm16ToFloat32(...)

Worker entry

@sherpaw/xsai-transcription/worker is still available for worker-based usage.