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

tiny-tts

v5.0.1

Published

Ultra-lightweight text-to-speech (1.6M params). Pure Node.js inference via ONNX Runtime — zero Python dependency.

Readme

TinyTTS

Ultra-lightweight Text-to-Speech for Node.js — 1.6M params, 44.1kHz, ~53x real-time on CPU.

npm PyPI

Pure Node.js offline TTS inference via ONNX Runtime. Zero Python dependency. The ONNX model (~6 MB) is auto-downloaded from HuggingFace on first use.

Installation

npm install tiny-tts

Quick Start

const TinyTTS = require('tiny-tts');

const tts = new TinyTTS();

// Synthesize and save to WAV
await tts.speak('Hello world!', { output: 'hello.wav' });

// With options
await tts.speak('This is a fast speech test.', {
  output: 'fast.wav',
  speaker: 'MALE',
  speed: 1.5
});

// Clean up
await tts.dispose();

CLI

# Basic usage
npx tiny-tts "Hello world!" -o hello.wav

# With options
npx tiny-tts "The weather is nice today." -o output.wav -s MALE --speed 1.2

Features

  • Offline inference — no server, no API calls, no Python needed
  • ONNX Runtime — fast CPU inference (~53x real-time)
  • Neural G2P — ported g2p_en GRU model for accurate pronunciation of any English word
  • Full CMU dictionary — 123,463 entries for precise phoneme lookup
  • 100% G2P match with Python (PyPI) version across 542 test sentences
  • Auto model download — ONNX model fetched from HuggingFace on first run

API

new TinyTTS(options?)

| Option | Type | Default | Description | |--------|------|---------|-------------| | modelPath | string | (auto-download) | Path to ONNX model file |

tts.speak(text, options?)

| Option | Type | Default | Description | |--------|------|---------|-------------| | output | string | 'output.wav' | Output WAV file path | | speaker | string | 'MALE' | Speaker ID (MALE or FEMALE) | | speed | number | 1.0 | Speech speed (0.3–3.0) |

Returns: Promise<Buffer> — WAV audio data (also saves to file if output is set)

tts.dispose()

Release ONNX session resources.

How It Works

  1. Text normalization — expands numbers, abbreviations, time expressions
  2. G2P pipeline — converts text to phonemes:
    • Apostrophe-aware word splitting (matches Python BERT tokenizer behavior)
    • CMU dictionary lookup (123K entries)
    • Neural G2P fallback (GRU encoder-decoder, identical to Python g2p_en)
  3. Phoneme → IDs — maps phonemes + tones to model input tensors
  4. ONNX inference — generates 44.1kHz audio waveform
  5. WAV output — saves as standard WAV file

Model Info

| Metric | Value | |--------|-------| | Parameters | 1.6M | | Model size | ~3.4 MB (ONNX FP16) | | Sample rate | 44.1 kHz | | CPU speed | ~53x real-time | | Language | English |

Python Version

Also available on PyPI with the same G2P output:

pip install tiny-tts
from tiny_tts import TinyTTS
tts = TinyTTS()
tts.speak("Hello world!", output_path="hello.wav")

License

Apache License 2.0

Links