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

@jsonstat-validator/wasm

v1.0.1

Published

WebAssembly surface of jsonstat-validator — a thin JS wrapper over the Rust crate, exposing the same validate() signature as @jsonstat-validator/ts.

Downloads

547

Readme

@jsonstat-validator/wasm

The WebAssembly surface of jsonstat-validator — a thin JS wrapper over the Rust crate, exposing the same validate() signature as @jsonstat-validator/ts so the two are drop-in compatible.

The Wasm build is produced from the crate with wasm-pack (--target web); the wrapper in src/index.ts adapts the validate_json export to the TS ValidationResult shape.

Built on top of the same rules-manifest.json and corpus/cases.json as the TS and Rust surfaces, so all three produce identical findings on identical input (enforced by the parity tests).


Install

npm install @jsonstat-validator/wasm

Usage

Browser / CDN

init() (no argument) fetches the adjacent .wasm over HTTP:

import { init, validate } from "@jsonstat-validator/wasm";

await init();                       // load the .wasm once
const result = validate(doc);       // doc may be an object OR a JSON string
console.log(result.valid, result.summary);

With a bundler (Vite/webpack/Rollup) the .wasm is emitted next to the JS automatically.

Node

The @jsonstat-validator/wasm/node entry auto-loads the .wasm bytes from disk on import, so no manual init() is needed, and it adds validateFile():

import { validate, validateFile } from "@jsonstat-validator/wasm/node";

const result = validate(doc);
const result2 = await validateFile("./my-cube.json");

(You can also use the main entry in Node by passing the bytes explicitly: await init(readFileSync(require.resolve("@jsonstat-validator/wasm/pkg/jsonstat_validator_bg.wasm"))).)


Differences from @jsonstat-validator/ts

| Concern | TS surface | Wasm surface | |---|---|---| | Lifecycle | none (pure JS) | await init() once (browser) / auto on Node | | options.onFinding | supported (JS callback) | ignored (functions can't cross the JS↔wasm boundary) | | options.budget | honored | ignored (Rust ValidateOptions skips unknown fields) | | meta.durationMs | wall-clock ms (number) | always 0wasm32-unknown-unknown has no Instant, so timing is skipped | | Finding shape (code/severity/path/message) | — | identical (parity-tested) |

If you don't need the Wasm performance characteristics or wasm-pack toolchain, prefer @jsonstat-validator/ts — it has zero native/Rust dependencies.


Building the Wasm artifact from source

# prerequisites (one-time)
rustup target add wasm32-unknown-unknown
cargo install wasm-pack

npm run build          # wasm-pack -t web -> packages/wasm/pkg, then tsc -> dist
npm test               # builds pkg and runs the TS↔Wasm corpus parity test

License

Apache-2.0.