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

@inkandswitch/bijoux

v0.1.0

Published

Bijective length-prefixed varint encodings, unsigned (u32/u64/u128) and signed zigzag (i32/i64/i128) — Wasm bindings

Downloads

167

Readme

@inkandswitch/bijoux (bijoux_wasm)

Wasm/JavaScript bindings for the bijoux family — bijective, length-prefixed varint encodings for u32, u64, and u128 in one npm package.

Flat, width-suffixed exports (tree-shakeable free functions):

import {
  decodeU64,
  decodeAllU64,
  encodeU64,
  encodedLenU64,
  MAX_BYTES_U64,
} from "@inkandswitch/bijoux";

encodeU64(300n);            // Uint8Array([0xF8, 0x34])
decodeU64(encodeU64(300n)); // Decoded64 { value: 300n, bytesRead: 2 }

| Family | Carrier type | decodeAll* returns | Max bytes | |--------|--------------|-----------------------|-----------| | U32 | number | Uint32Array | 5 | | U64 | bigint | BigUint64Array | 9 | | U128 | bigint | Array<bigint> | 17 | | I32 | number | Int32Array | 5 | | I64 | bigint | BigInt64Array | 9 | | I128 | bigint | Array<bigint> | 17 |

Each width exposes encode*, decode*, decodeAll*, encodedLen*, MAX_BYTES_*(), and a Decoded{U,I}{32,64,128}-family result class. Decode errors throw Error with name === "Bijou{32,64,128}{,s}DecodeError" (the s suffix for the signed formats); wrong-type and out-of-range inputs throw native TypeError / RangeError. Signed range checks are two-sided (e.g. encodeI64 accepts [-(2n ** 63n), 2n ** 63n)).

Panics and runtime requirements

The Wasm is built with panic=unwind: a recoverable Rust panic surfaces as a catchable JavaScript Error with name === "PanicError" (async exports reject their Promise), and the Wasm instance remains usable afterward. Hard faults (stack overflow, OOM) still terminate the instance.

This uses legacy Wasm exception-handling opcodes, which require Node 20+ (see engines in package.json) or a current evergreen browser. Node 18 and older runtimes fail at instantiation with a CompileError.

Building and testing

Built into a universal npm package via wasm-bodge (bodge in the dev shell). Tests: wasm:test:node (Rust ↔ wasm-bindgen ABI), test:js:node (Mocha against dist/esm/node.js), test:js:browser (Playwright against dist/esm/web.js).

License

MIT OR Apache-2.0