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

@innovatorssoft/native

v0.1.0

Published

Native accelerators for zapo-js (Rust NAPI addon + WASM fallback)

Readme

@zapo-js/native

Optional native accelerators for zapo-js. Moves the crypto hot path off pure JavaScript and onto a compiled backend, with transparent fallback so the client works everywhere regardless of what's installed.

How it works

The same Rust core is shipped two ways, selected at load time. Callers never change – the client resolves the fastest available backend and degrades gracefully:

| Backend | What it is | Requires | | -------- | ---------------------------------------- | ------------------------------------- | | napi | Compiled Rust addon (fastest) | Building from source (Rust toolchain) | | wasm | WebAssembly build of the same Rust core | Nothing – ships inside this package | | js | Pure-JS / node:crypto (no accelerator) | Nothing – built into zapo-js |

If the native addon can't load, the WASM fallback is used; if that's disabled, the pure-JS path in zapo-js takes over. Installing this package is always safe: a missing or unsupported binary never breaks the client.

Install

npm install @zapo-js/native

The published package currently ships the WASM backend only – it works on any OS/arch with no toolchain. Prebuilt NAPI binaries are not on npm yet; to use the (faster) native addon, build it from source inside a repo checkout with a Rust toolchain installed:

npm run build:napi -w packages/native

Backend selection

The default (auto) tries the NAPI addon first, then the WASM build, then the pure-JS path. To pin a single backend, set ZAPO_NATIVE_BACKEND before the process starts:

ZAPO_NATIVE_BACKEND=napi   # only the native addon
ZAPO_NATIVE_BACKEND=wasm   # only the WebAssembly build
ZAPO_NATIVE_BACKEND=js     # disable the accelerator, use the pure-JS path

A pinned backend that is unavailable does not error – the client silently falls back to the pure-JS path.

One WASM artifact, Node and browser

The WASM backend is a single --target web build under wasm/pkg/ – the same artifact serves both environments:

  • Node: zapo-js loads it automatically (the glue is ESM, loaded via require(esm) and initialised synchronously with the bundled .wasm bytes). This needs Node 20.19+ / 22.12+; on older runtimes the client silently falls back to the pure-JS path.
  • Browser / bundler: import it directly and initialise before use:
import init, {
    x25519ScalarMult,
    xeddsaSign,
    xeddsaVerify
} from '@zapo-js/native/wasm/pkg/zapo_native_wasm.js'

await init()
const shared = x25519ScalarMult(privateKey, publicKey)

Notes

  • Optional by design. The accelerator is a performance layer, not a correctness dependency – outputs are byte-identical across all three backends (verified by the cross-check tests).
  • ABI-stable binaries. The native addon is built with N-API, so one binary per platform works across every supported Node version – no rebuild on Node upgrades.
  • WASM runs anywhere. The bundled WebAssembly fallback runs on any platform the native addon doesn't cover.
  • The root import is the NAPI addon. require('@zapo-js/native') resolves to the compiled addon, so on the published wasm-only package it throws a module-not-found error – that failure is exactly what makes zapo-js fall through to the WASM build. To use the primitives directly, import the wasm/pkg subpath shown above.

See the main zapo-js docs for the client contract.