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

@peerbit/indexer-rust

v1.0.4

Published

Rust-backed indexer for document stores

Readme

@peerbit/indexer-rust

Experimental Rust-backed indexer package for the Peerbit indexer interface.

Current shape

  • Rust/WASM owns the ordered key/value entry store.
  • src/planner.rs contains the first native query planner core: typed query AST, bitmap set operations, scalar sorting, batch updates, and vector ranking.
  • The TypeScript adapter implements the existing @peerbit/indexer-interface query semantics.
  • Persistence uses a compacted snapshot plus an incremental operation journal. Node.js writes through the native filesystem and browser builds write through OPFS.
  • The same conformance suite runs in transient and persistent mode across Node.js, browser, and webworker targets.

This package does not use SQLite, libsqlite3-sys, libSQL, or Turso yet. It is the package and persistence boundary for moving more index work native without coupling that decision to the higher Peerbit modules.

Performance direction

The current package benchmark is mostly a baseline for product integration. Point lookups and writes are cheap, and supported field queries now route through the native planner. The next performance proof should compare explicit @peerbit/indexer-rust usage against simple/sqlite in document and shared-log style workloads.

Durability model

Persistent indexes keep two primary files per scope/index:

  • index.bin: compacted, checksummed Borsh snapshot of the current values.
  • index.wal: append-only operation journal containing checksummed put/delete records.

Each successful persistent put or del appends its journal record before the operation resolves. Reopening the index loads index.bin and replays index.wal, so committed writes do not depend on a clean stop(). stop() compacts the current state back into index.bin and removes the journal. Long-running indexes also compact after enough journaled operations to keep startup replay bounded. Compaction writes index.bin.tmp first; startup can recover from that temp snapshot if a primary snapshot write is torn before the journal is removed.

The default persistence durability is normal, matching the practical SQLite WAL synchronous=NORMAL tradeoff: write operations append to the WAL and snapshots are synced during compaction, but individual writes do not force a filesystem sync. Use create(directory, { persistence: { durability: "strict" } }) when every single write must be synced before its promise resolves.

On Node.js the journal uses filesystem append, with best-effort directory sync around compaction. In browsers it uses OPFS, preferring createSyncAccessHandle() when available and falling back to writable files otherwise.