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

krio-stt

v1.0.0

Published

Speech-to-text for Krio and other African languages — powered by Whisper large-v3 via Hugging Face

Readme

krio-stt

Speech-to-text for Krio and other African languages — powered by Whisper large-v3 via the Hugging Face Inference API.

Works with voice notes from WhatsApp, Telegram, local files, or any audio URL. No extra dependencies — pure Node.js.

Why Whisper large-v3?

Standard STT engines struggle with Krio (Sierra Leonean Creole), Nigerian Pidgin, and heavily accented speech. Whisper large-v3 is trained on a wide range of languages and accents and handles these significantly better than smaller models.

Installation

npm install krio-stt

Or use it locally in a monorepo:

npm install ../krio-stt

Quick Start

const { transcribeUrl, transcribeBuffer, transcribeFile } = require('krio-stt');

Set your Hugging Face API key (free at huggingface.co/settings/tokens):

export HUGGINGFACE_API_KEY=hf_...

Transcribe from a URL

// Public URL — no auth needed
const text = await transcribeUrl('https://example.com/audio.ogg');

// Protected URL — pass a Bearer token
const text = await transcribeUrl(mediaUrl, {
  auth: { bearer: process.env.WHAPI_TOKEN },
});

Transcribe from a Buffer

const text = await transcribeBuffer(audioBuffer, {
  contentType: 'audio/ogg',
});

Transcribe from a local file

const text = await transcribeFile('/path/to/voice.ogg');

Auth Options

The auth option in transcribeUrl supports multiple formats:

// Bearer token (WhatsApp / Whapi, most APIs)
{ auth: { bearer: 'TOKEN' } }

// Basic auth
{ auth: { basic: { user: 'username', pass: 'password' } } }

// Arbitrary header
{ auth: { header: { key: 'X-API-Key', value: 'TOKEN' } } }

// Raw Authorization header value
{ auth: 'Bearer TOKEN' }

Platform Examples

WhatsApp (via Whapi)

const { transcribeUrl } = require('krio-stt');

// In your webhook handler:
if (message.type === 'audio') {
  const text = await transcribeUrl(message.media.url, {
    auth: { bearer: process.env.WHAPI_TOKEN },
  });
  // text is now the Krio/English transcript — handle it like a typed message
}

Telegram

const { transcribeUrl } = require('krio-stt');

// After calling getFile to resolve file_path:
const url = `https://api.telegram.org/file/bot${BOT_TOKEN}/${file_path}`;
const text = await transcribeUrl(url); // no auth header needed — token is in URL

Express file upload

const { transcribeBuffer } = require('krio-stt');

app.post('/transcribe', upload.single('audio'), async (req, res) => {
  const text = await transcribeBuffer(req.file.buffer, {
    contentType: req.file.mimetype,
  });
  res.json({ transcript: text });
});

API Reference

transcribeUrl(url, [options])Promise<string>

| Option | Type | Default | Description | |---------------|--------|--------------------------|----------------------------------------| | auth | object | — | Auth config for downloading the file | | contentType | string | auto-detected | Override MIME type | | apiKey | string | HUGGINGFACE_API_KEY | Hugging Face API key | | model | string | openai/whisper-large-v3| Whisper model ID | | timeout | number | 60000 | Request timeout in milliseconds |

transcribeBuffer(buffer, [options])Promise<string>

Same options as above except auth (not applicable).

transcribeFile(filePath, [options])Promise<string>

Same options as transcribeBuffer. Content-type is inferred from the file extension.

Notes

  • The Hugging Face free tier may have a cold-start delay (~20–30s) if the model hasn't been used recently. The first request after a period of inactivity will take longer.
  • Audio files must be under 25 MB (Whisper's hard limit).
  • For production use, consider a paid HF Inference Endpoint to avoid cold starts.

License

MIT