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

lyrravoice

v0.1.0

Published

Official TypeScript SDK for LyrraVoice — AI text-to-speech with voice cloning

Readme

lyrravoice

Official TypeScript SDK for LyrraVoice — AI text-to-speech with voice cloning powered by XTTS v2.

  • Zero dependencies (uses native fetch, Node.js 18+)
  • Full TypeScript support with ESM + CJS dual build
  • Covers all public API endpoints (TTS, voices, jobs, MCP keys)

Installation

npm install lyrravoice

Quick Start

import { LyrraVoice } from "lyrravoice";

const client = new LyrraVoice({
  apiKey: "lv_...",
  baseUrl: "https://your-server.com",
});

// Generate speech and save to file
const audio = await client.generate({
  text: "Bonjour, bienvenue sur LyrraVoice !",
  voice_id: "marc",
  language: "fr",
});
await audio.save("output.wav");

Usage

Synchronous TTS

const audio = await client.generate({
  text: "Hello world",
  voice_id: "sara",
  language: "en",
  format: "mp3",
  speed: 1.2,
});

// Save to file
await audio.save("hello.mp3");

// Or get raw buffer
const buffer = await audio.buffer();

Async TTS (Celery jobs)

// Submit job
const { job_id } = await client.generateAsync({
  text: "A very long text...",
  voice_id: "marc",
});

// Poll until complete
const job = await client.jobs.poll(job_id, {
  interval: 2000,
  timeout: 60000,
});

// Download result
if (job.download_url) {
  const audio = await client.jobs.download(job.download_url.split("/").pop()!);
  await audio.save("result.wav");
}

SSE Streaming

for await (const event of client.stream({ text: "Streaming audio..." })) {
  console.log(`Chunk ${event.chunk}/${event.total}`);
  // event.audio contains base64-encoded WAV data
  const chunk = Buffer.from(event.audio, "base64");
}

Voice Management

import fs from "node:fs";

// List voices
const voices = await client.voices.list();

// Clone a voice from audio
const result = await client.voices.clone({
  name: "my-voice",
  audio: fs.readFileSync("recording.wav"),
});

// Rename
await client.voices.rename("my-voice", "custom-narrator");

// Delete
await client.voices.delete("custom-narrator");

// Import a built-in preset
await client.voices.importPreset({ speaker_name: "Claribel Dervla" });

Audio Processing

import fs from "node:fs";

const cleaned = await client.audio.clean({
  file: fs.readFileSync("noisy.wav"),
});
await cleaned.save("clean.wav");

MCP API Keys

// Create a key (full key is returned only once)
const key = await client.mcp.createKey("ci-pipeline");
console.log(key.key); // "lv_..."

// List keys
const keys = await client.mcp.listKeys();

// Revoke
await client.mcp.revokeKey(key.id);

// Server info
const info = await client.mcp.info();

Health Check

const health = await client.health();
// { status: "ok", model: "xtts_v2", device: "cpu" }

Error Handling

import { APIError, TimeoutError } from "lyrravoice";

try {
  await client.generate({ text: "" });
} catch (err) {
  if (err instanceof APIError) {
    console.error(err.status); // 422
    console.error(err.detail); // "Text is required"
  }
  if (err instanceof TimeoutError) {
    console.error("Job took too long");
  }
}

Configuration

const client = new LyrraVoice({
  apiKey: "lv_...",             // MCP API key
  // OR
  token: "eyJ...",             // JWT bearer token
  baseUrl: "http://localhost:5050", // Server URL (default)
  timeout: 60000,              // Request timeout in ms (default: 30000)
});

License

MIT