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

@stll/anonymize-wasm

v2.0.1

Published

PII detection and anonymization for browsers via WebAssembly. Same native SDK API as @stll/anonymize.

Readme

@stll/anonymize-wasm

Browser-friendly build of @stll/anonymize.

Use this package when you need the runtime API in a browser or bundler environment. It ships the WebAssembly build and the Vite helper that keeps the wasm assets out of dependency pre-bundling.

Install

bun add @stll/anonymize-wasm

Usage

Same native-SDK surface as @stll/anonymize/native, backed by the WebAssembly binding. Browsers load prebuilt prepared packages (there is no in-browser config building). The wasm binding is instantiated lazily on first use.

import { loadDefaultPipeline } from "@stll/anonymize-wasm";

// Loads the compressed default package bundled in the tarball.
const pipeline = await loadDefaultPipeline();
const { redaction } = pipeline.redactText("A contract signed by Jan Novak.");
console.log(redaction.redactedText);

Bring your own prepared package (bytes, an ArrayBuffer, or a URL to fetch):

import { loadPipeline } from "@stll/anonymize-wasm";

const pipeline = await loadPipeline(
  new URL("./my-package.stlanonpkg", import.meta.url),
);

With Vite, register the helper plugin so the wasm binary, WASI worker, and .stlanonpkg assets survive both dependency pre-bundling (dev) and a production vite build (the plugin emits the native/ assets and rewrites the runtime asset base to point at them):

import stllAnonymizeWasm from "@stll/anonymize-wasm/vite";
// vite.config: plugins: [stllAnonymizeWasm()]

By default the plugin emits every bundled prepared package into your build. The full-dictionary default package alone is large (~20 MB), plus the per-language cs, de, and en variants. If your app only needs some of them, restrict the emitted packages with the packages option (the wasm binary, glue, and workers are always emitted):

// Emit only the Czech scoped package.
stllAnonymizeWasm({ packages: ["cs"] });

// Emit the full-dictionary default plus English.
stllAnonymizeWasm({ packages: ["default", "en"] });

// Emit no prepared packages; the app supplies its own to loadPipeline().
stllAnonymizeWasm({ packages: "none" });

// Emit everything (the default).
stllAnonymizeWasm({ packages: "all" });

"default" selects the full-dictionary package that loadDefaultPipeline() (no argument) loads; a language code selects the scoped package that loadDefaultPipeline("cs") loads. Requesting a package that is not bundled fails the build.

Interplay with the runtime loaders: the plugin only controls which assets ship, not which the code asks for. Calling loadDefaultPipeline(language) for a package you did not emit resolves to a missing asset URL and rejects with a fetch error at runtime. Keep the packages list aligned with the languages your app actually loads, or load your own package bytes through loadPipeline.

Notes

  • Same redaction core as @stll/anonymize, running in WebAssembly.
  • The binding targets wasm32-wasip1-threads (shared memory), so it needs a cross-origin-isolated context (SharedArrayBuffer) in the browser.

Third-party licenses

The shipped browser WASI glue (dist/native/index.wasi-browser.js and dist/native/wasi-worker-browser.mjs) is bundled at build time and inlines the following MIT-licensed runtime so it is self-contained for consumer bundlers:

  • @napi-rs/wasm-runtime (MIT) — Copyright (c) napi-rs authors — https://github.com/napi-rs/napi-rs
  • @tybys/wasm-util (MIT) — Copyright (c) toyobayashi — https://github.com/toyobayashi/wasm-util

Both are distributed under the MIT License; the full license text is available in each project's repository.

Building from source

The wasm binding is generated by napi-rs and is not checked in:

cd packages/anonymize
bun run build:native-wasm   # needs the wasm32-wasip1-threads Rust target
bun run build               # tsdown + native node binding
bun run build:wasm-assets   # copy glue + build compressed packages into wasm/dist/native

The wasm32-wasip1-threads target is pinned in rust-toolchain.toml, so rustup installs it automatically; with a non-rustup toolchain run rustup target add wasm32-wasip1-threads first.