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

xit-wasm

v0.1.0

Published

Versioned in-memory archives via xit (Zig VCS) compiled to WebAssembly. Browser-friendly.

Readme

xit-wasm

Versioned in-memory archives for TypeScript, backed by the xit version control system compiled to WebAssembly. Pure in-memory by default, so it runs identically in Node, Bun, Deno, and the browser.

import { Archive } from "xit-wasm";

const a = await Archive.open();                    // fresh repo
await a.write("manifest.json", encode({ v: 1 }));
await a.write("data/foo.json",  encode({ x: 1 }));
await a.commit("initial");

await a.branch("feature");
await a.checkout("feature");
await a.write("data/foo.json", encode({ x: 2 }));
await a.commit("bump x");

await a.checkout("master");
await a.merge("feature");                          // fast-forward

const bytes = await a.toBytes();                   // serialize to a zip
// …round-trip…
const b = await Archive.open(bytes);
console.log(await b.log());                        // CommitInfo[]

What this is

A thin TypeScript surface over a slimmed-down build of xit (Zig) compiled to wasm32-wasi. Networking, the TUI, and the CLI are stripped; what remains is the git/xit object model, the index/tree/pack/chunk machinery, and the merge engine. We provide a pure in-memory Host that backs the wasm filesystem with a JS map, so the public API has no dirCreateFile / file-handle / wasm concept anywhere — just archive.write(path, bytes), archive.commit(message), etc.

The on-disk shape inside an archive's zip stream is a real xit working directory, including a .xit/ subtree (single-file xitdb + content chunks). Power users can unzip a .甲 and find a fully-formed repo.

Credit and provenance

This package wraps xit, a brand-new version control system written in Zig by radarroark. xit aims to be a worthy successor to git and is well worth exploring on its own:

This package is a downstream WebAssembly binding maintained by rheophile10. None of the version-control engine is original work here — the Zig source we compile lives at https://github.com/rheophile10/xit/tree/wasm-spike, a fork that strips the parts wasm doesn't need (networking, TUI, CLI) and adds the C ABI exports the bindings call into. Any improvements to the underlying engine should go upstream to https://github.com/xit-vcs/xit.

API

The headline class is Archive. Construction:

const fresh = await Archive.open();              // new repo on `master`
const opened = await Archive.open(zipBytes);     // existing repo from a .甲

Content (no wasm round-trip — pure in-memory writes):

await archive.write(path, content);
const bytes = await archive.read(path);
const paths = await archive.list();
await archive.remove(path);

Version control (each call goes through wasm):

const oid = await archive.commit(message, { author? });
const history = await archive.log({ limit? });   // CommitInfo[]
await archive.branch(name);
const { branches, current } = await archive.listBranches();
const name = await archive.currentBranch();      // string | null
await archive.checkout(branch);
const result = await archive.merge(branch, { message?, author? });
// MergeResult: { kind: "success", oid } | "fast_forward" | "nothing" | "conflict"

Persistence:

const bytes = await archive.toBytes();           // zip the working tree
await archive.close();                           // release the wasm handle

Loading the wasm module

The package ships xit.wasm next to its entry module. By default Archive.open() resolves it via new URL("../xit.wasm", import.meta.url), which Just Works in Node and most modern bundlers. For environments where that doesn't (some bundlers strip import.meta.url, browser deployments fetching from a CDN, etc.) configure the source explicitly:

import { setDefaultWasmSource } from "xit-wasm";

setDefaultWasmSource(new URL("https://cdn.example.com/xit.wasm"));
// or
setDefaultWasmSource(preloadedBytes);

Or pass per-call:

await Archive.open(bytes, { wasm: customSource });

Filesystem interop

xit-wasm is intentionally fs-free. If you want to drive xit against a real filesystem (CLI tools, tests against an unzipped tree), import the Node host:

import { NodeHost } from "xit-wasm/node";

This exists primarily for the smoke tests under example/; most consumers should reach for Archive and let MemoryHost back it.

Status

Alpha. The headline ops (init / open / write / commit / log / branch / checkout / merge / toBytes) work and are validated end-to-end against native git for the .git repo kind. The default .xit repo kind round- trips through xitdb. There is no networking; conflict resolution beyond "detect and report" is not yet wired into the JS surface; performance has not been profiled.

Building from source

# 1. build the wasm (requires zig 0.16)
cd ../xit && zig build wasm

# 2. build the TS package + copy xit.wasm into place
cd ../xit-wasm-ts && npm install && npm run build

License

MIT.