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

nisaba-db

v1.0.0

Published

A WASM/C, MongoDB-driver-shaped embedded document database for Node and the browser: CRUD, query operators, $regex, secondary/geo/text indexes, change streams. One wasm binary serves both platforms; only the storage provider differs.

Readme

nisaba-db

A WASM/C, MongoDB-driver-shaped embedded document database for Node and the browser: CRUD, query operators, $regex, secondary/geo/text indexes, aggregation, change streams — the driver surface you already know, with the engine compiled to WebAssembly and your data in files you own.

One build serves both platforms. The wasm binary and its loader detect their environment (Node, browser main thread, worker) themselves; there are no separate node/browser artifacts. The only thing that differs per platform is which storage provider you hand to connect.

Node

import { ready } from 'nisaba-db/wasm';
import { connect, NodeFSStorageProvider } from 'nisaba-db/node';

await ready();                       // loads the wasm engine, once per process
const db = await connect(new NodeFSStorageProvider('./data'));
const users = await db.collection('users');
await users.insertOne({ name: 'Ada', team: 'core' });
const ada = await users.findOne({ name: 'Ada' });
await db.close();

NodeFSStorageProvider stores each collection in ordinary files under the directory you name, holds an advisory lock so two processes cannot open the same database, and its flush() is a real fsync.

Browser

import { ready } from 'nisaba-db/wasm';
import { connect, OPFSStorageProvider, MemoryStorageProvider } from 'nisaba-db';

await ready();
const db = await connect(new OPFSStorageProvider());   // origin-private file system
// or: await connect(new MemoryStorageProvider());     // ephemeral, e.g. tests

OPFS sync access handles are exclusive per file, so one context owns the database's files at a time. For multiple tabs, each tab runs a worker, and connectShared elects exactly one of those workers the owner — the rest proxy to it transparently, and the election re-runs when the owning tab closes:

// inside each tab's worker
import { connectShared } from 'nisaba-db/coordinator';
import { OPFSStorageProvider } from 'nisaba-db';

const db = await connectShared('my-app', new OPFSStorageProvider());
// same Db shape as connect(): collections, queries, watch(), ...

Everything else

Queries, updates, indexes, cursors, aggregation, change streams, watch(), TTL, compaction — the API is the MongoDB driver shape throughout; see the repository's docs/db-api.md for the full surface and its deliberate differences.

The replicated server, its client, and the HTTP front end are not in this package — this is the database you embed. They live in the repository package.

Building this package

Every shipped file is copied from the repository at pack time (prepack runs ../nisaba-db.build.mjs — the assembly script lives beside this directory, not in it, so the package holds only what ships), and the package cannot drift from what the repository builds and tests. From a repo checkout:

cd packages/nisaba-db
npm run build      # assembles src/, wasm/, types/, third_party/
npm test           # a smoke round-trip over both providers
npm pack           # the publishable tarball

License

BSD-2-Clause.