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 🙏

© 2025 – Pkg Stats / Ryan Hefner

vunt

v1.0.2

Published

A browser-first, content-addressed chunk store with a simple API and GC, designed to run without a build step and verified via Cypress E2E tests. The store is now OPFS-backed for persistence in modern browsers.

Downloads

9

Readme

vunt

A browser-first, content-addressed chunk store with a simple API and GC, designed to run without a build step and verified via Cypress E2E tests. The store is now OPFS-backed for persistence in modern browsers.

  • No build/transpile: native ESM, modern browsers
  • Persistent storage: OPFS (Origin Private File System)
  • Tests: Cypress
  • Hashing: Web Crypto SHA-256 (64-hex digest)

See chunk-store-prd.md for the full PRD.

Quick start

Prereqs: Node 18+ and pnpm.

pnpm i
pnpm dev   # serves the demo at http://localhost:3000
# In another terminal
pnpm cy:open   # interactive
# or
pnpm cy:run    # headless

Demo: using the API in the browser

Open http://localhost:3000. The demo page lets you:

  • Create a store
  • Put text and see the resulting hash
  • Check has(hash) and get(hash)
  • Run a GC cycle: beginGCCycle -> markReachable -> sweep
  • Inspect getStats()

The page imports the library directly:

<script type="module">
  import { createChunkStore, enc, dec } from "../index.js";
  // ...
</script>

Library API

The interface follows the PRD. The implementation is browser-native and OPFS-backed for persistence.

interface ChunkStore {
  // Core operations
  put(data: Uint8Array): Promise<string>; // returns sha256 hex
  get(hash: string): Promise<Uint8Array | null>;
  has(hash: string): Promise<boolean>;

  // Garbage collection
  beginGCCycle(): Promise<void>;
  markReachable(hash: string): Promise<void>;
  sweep(): Promise<void>;

  // Management
  close(): Promise<void>;
  getStats(): Promise<StoreStats>;
}

interface StoreStats {
  totalChunks: number;
  totalSize: number;
  segmentCount: number;
  cacheHitRate: number;
}

interface ChunkStoreConfig {
  name: string;
  segmentSize?: number;
  cacheSize?: number;
  writeBufferSize?: number;
  hashAlgorithm?: "sha256" | "blake3"; // currently only sha256 is implemented
}

// Factory
function createChunkStore(config?: ChunkStoreConfig): Promise<ChunkStore>;

Examples

Basic put/get

import { createChunkStore, enc, dec } from "vunt";

const store = await createChunkStore({ name: "demo" });
const hash = await store.put(enc("hello vunt"));
console.log("hash:", hash); // 64-hex sha256

const data = await store.get(hash);
console.log("value:", data ? await dec(data) : null);

Existence check

const ok = await store.has(hash);
console.log("has?", ok);

GC cycle (mark-and-sweep)

await store.beginGCCycle();
await store.markReachable(hash); // mark the chunk you want to keep
await store.sweep(); // unmarked chunks are removed

Stats and teardown

const stats = await store.getStats();
console.log(stats); // { totalChunks, totalSize, segmentCount, cacheHitRate }

await store.close();

Project structure

  • src/index.js — public exports; OPFS-backed store under the PRD API
  • src/webapp/index.html — demo UI to explore API
  • src/webapp/server.js — ESM static dev server (http://localhost:3000)
  • cypress/ — E2E tests; basic.cy.js runs the demo app flow
  • chunk-store-prd.md — Product Requirements Document
  • directory.md — Repo map and developer guide

Notes and constraints

  • Browser-first, no bundler: public modules must be loadable directly by the browser (ESM only)
  • Hashing: Web Crypto SHA-256; BLAKE3 may be considered later
  • Storage: OPFS-backed segments with in-memory index and simple GC rewrite

Types

This library is authored in plain JavaScript and ships TypeScript type declarations only. No runtime build step is required.

  • Types output: dist/types/index.d.ts
  • Entry points: ESM at src/index.js, types via package.json#types and exports map

Usage:

import {
  createChunkStore,
  enc,
  dec,
  type ChunkStore,
  type ChunkStoreConfig,
} from "vunt";

const cfg: ChunkStoreConfig = { name: "demo" };
const store: ChunkStore = await createChunkStore(cfg);

Roadmap

  1. MVP: OPFS segments + in-memory index; put/get/has persistently — DONE
  2. GC: mark-and-sweep across segments; compaction; index persistence (basic GC rewrite present; index persistence TBD)
  3. Performance: write batching, LRU cache, Bloom filter for has
  4. Reliability: WAL, crash recovery, checksums

License

ISC