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

@picovoice/zebra-web

v1.0.0

Published

Zebra Text Translation engine for web browsers (via WebAssembly)

Readme

Zebra Binding for Web

Zebra Translate

Made in Vancouver, Canada by Picovoice

Zebra is a lightweight, on-device neural machine translation engine. Zebra is:

  • Private; All processing runs locally.
  • Cross-Platform:
    • Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64, arm64)
    • Raspberry Pi (3, 4, 5)
    • Chrome, Safari, Firefox, and Edge

Compatibility

  • Chrome / Edge
  • Firefox
  • Safari

Requirements

The Zebra Web Binding uses SharedArrayBuffer.

Include the following headers in the response to enable the use of SharedArrayBuffers:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

Refer to our Web demo for an example on creating a server with the corresponding response headers.

Browsers that don't support SharedArrayBuffers or applications that don't include the required headers will fall back to using standard ArrayBuffers. This will disable multithreaded processing.

Restrictions

IndexedDB is required to use Zebra in a worker thread. Browsers without IndexedDB support (i.e. Firefox Incognito Mode) should use Zebra in the main thread.

Multi-threading is only enabled for Zebra when using on a web worker.

Installation

Using yarn:

yarn add @picovoice/zebra-web

or using npm:

npm install --save @picovoice/zebra-web

AccessKey

Zebra requires a valid Picovoice AccessKey at initialization. AccessKey acts as your credentials when using Zebra SDKs. You can get your AccessKey for free. Make sure to keep your AccessKey secret. Signup or Login to Picovoice Console to get your AccessKey.

Usage

For the web packages, there are two methods to initialize Zebra.

Public Directory

NOTE: Due to modern browser limitations of using a file URL, this method does not work if used without hosting a server.

This method fetches the model file from the public directory and feeds it to Zebra. Copy the model file into the public directory:

cp ${ZEBRA_MODEL_FILE} ${PATH_TO_PUBLIC_DIRECTORY}

Base64

NOTE: This method works without hosting a server, but increases the size of the model file roughly by 33%.

This method uses a base64 string of the model file and feeds it to Zebra. Use the built-in script pvbase64 to base64 your model file:

npx pvbase64 -i ${ZEBRA_MODEL_FILE} -o ${OUTPUT_DIRECTORY}/${MODEL_NAME}.js

The output will be a js file which you can import into any file of your project. For detailed information about pvbase64, run:

npx pvbase64 -h

Model

Zebra saves and caches your model file in IndexedDB to be used by WebAssembly. Use a different customWritePath variable to hold multiple models and set the forceWrite value to true to force re-save a model file.

Either base64 or publicPath must be set to instantiate Zebra. If both are set, Zebra will use the base64 model.

const zebraModel = {
  publicPath: ${MODEL_RELATIVE_PATH},
  // or
  base64: ${MODEL_BASE64_STRING},

  // Optionals
  customWritePath: "zebra_model",
  forceWrite: false,
  version: 1,
}

Translation Models

Zebra translation models are located here. The selected model decides the source and target translation languages.

The format of the model follows:

zebra_params_${SOURCE}_${TARGET}.pv

Where ${SOURCE} is the language code of the source language and ${TARGET} is the language code of the target language for the translation.

Initialize Zebra

Create an instance of Zebra in the main thread:

const zebra = await Zebra.create(
  "${ACCESS_KEY}",
  zebraModel
);

Or create an instance of Zebra in a worker thread:

const zebra = await ZebraWorker.create(
  "${ACCESS_KEY}",
  zebraModel
);

Translating Text

const translation = await zebra.translate(`${TEXT_TO_TRANSLATE}`);
console.log(translation);

Clean Up

Clean up used resources by Zebra or ZebraWorker:

await zebra.release();

Terminate ZebraWorker instance:

await zebra.terminate();

Demo

For example usage refer to our Web demo application.