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

@tapra/sdk

v0.1.7

Published

Official TypeScript SDK for the Tapra API: Tunisian code-switching transcription, speech, translation, and script conversion.

Readme

Tapra TypeScript SDK

Official TypeScript client for the Tapra API: Tunisian Arabic / French / English code-switching transcription, speech, translation, and Arabizi ↔ Arabic conversion. ESM, Node.js 22+ and modern browsers, no runtime dependencies.

import { TapraClient, Tapra } from '@tapra/sdk';

const client = new TapraClient(); // https://api.tapra.tn; apiKey defaults to TAPRA_API_KEY

const transcript = await client.transcriptions.create({ file: audioFile, timestamps: 'word' });
await client.script.convert({ text: '3lech 7abit l9anoun?', direction: 'ZI2AR' });

// Translations are currently offline (the endpoint returns an error until Tapra-Translate is back).
for await (const event of await client.translations.createStream({ input: 'عندي برشا خدمة', target: 'French' })) {
  process.stdout.write(event.delta ?? '');
}

Pass baseUrl to target another host, such as a local model host.

Errors are typed (Tapra.PaymentRequiredError for HTTP 402, …) and carry body.error.type. Pass { idempotencyKey } as request options to retry metered requests safely, and call .withRawResponse() to read x-tapra-cost-tnd.

Realtime transcription

import { connectRealtime } from '@tapra/sdk';

const session = await connectRealtime({ language: 'ar-AR' }); // wss://api.tapra.tn
session.on('partial', (event) => render(event.text));
session.sendAudio(pcmChunk); // mono pcm_s16le, 16 kHz
const final = await session.stop();

The key is sent as the tapra-auth.<key> WebSocket subprotocol, never in the URL. In a browser, pass a short-lived session token as apiKey, not a permanent key.

Prices

Tapra charges and invoices in TND only. The SDK does not hardcode any price: it reads the same live price list the website and the meter use.

import { fetchTapraPrices, estimateCostTnd } from '@tapra/sdk';

const prices = await fetchTapraPrices(); // GET https://www.tapra.tn/api/pricing, no key needed

estimateCostTnd(prices, 'tts', 1200); // 0.24 TND — 1,200 characters

estimateCostMicroTnd returns the exact integer amount the meter charges, including the per-request minimum for text products.

Development

src/ is generated by Fern from openapi/tapra-api.json; do not edit it by hand. lib/ (package entry, realtime helper, price list) is hand-written. Tests: sdks/tests/typescript.

Command line

The package ships a tapra command (npm install -g @tapra/sdk, or npx -p @tapra/sdk tapra ...). Same commands as the Python package's:

tapra auth login                               # checks the key, then saves it
tapra transcribe call.mp3                      # Derja + French + English, speakers labelled
tapra transcribe video.mp4 --format srt -o subs.srt   # any audio/video; long files are split (needs ffmpeg)
tapra stream --partials                        # live from the microphone (ffmpeg), Ctrl+C to stop
tapra speak "حبيت نتلقاو demain" --voice zeineb -o hello.wav
tapra flip "3lech 7abit l9anoun?"               # -> علاش حبيت القانون؟
tapra translate "chnowa el jaw?" --to French
tapra balance                                  # also: models, voices, pricing, languages, health

In a terminal, paid commands show the estimated cost and your balance and ask first (-y skips, --max-cost 0.5 sets a limit). They print the exact cost and balance on stderr when done; --json prints the full response and --dry-run shows the request without sending it. Exit codes: 0 ok, 1 error, 2 bad usage, 3 missing or invalid key, 4 balance too low. Full reference: https://www.tapra.tn/cli