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

sorodb

v0.0.1

Published

Embedded document database built on SlateDB

Readme

SoroDB

SoroDB is an embedded document database for Node.js, built on SlateDB. Define a schema, store JavaScript documents, and query them with indexes, transactions, and snapshot-backed pagination.

SoroDB is an ECMAScript module and requires Node.js 20 or later.

Quick start

import SoroDB from "sorodb";

const db = SoroDB({ store: "memory:///", path: "quick-start" });
db.schema({ version: 1 }, [
	{
		table: "users",
		columns: {
			id: { type: "number", primary: true },
			name: { type: "string" },
		},
	},
]);

try {
	const users = await db.collection("users");
	await users.create({ id: 1, name: "Ada" });
	const page = await users.filter({ where: (w) => w.eq("name", "Ada") }).page();
	console.log(page.items); // [{ id: 1, name: "Ada" }]
} finally {
	await db.close();
}

Register the schema before the first collection or transaction call. Always close the database to release the underlying store and any active query snapshots.

Store data in Amazon S3

Create a bucket and give the application read and write access to it. Set AWS_DEFAULT_REGION to the bucket's region and provide credentials through the environment, such as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY (plus AWS_SESSION_TOKEN for temporary credentials). The S3 object-store configuration lists supported environment variables.

Replace your-bucket-name with your bucket. The store URL selects the bucket; path places this database under the sorodb-demo prefix in that bucket.

import SoroDB from "sorodb";

const db = SoroDB({ store: "s3://your-bucket-name", path: "sorodb-demo" });
db.schema({ version: 1 }, [
	{
		table: "users",
		columns: {
			id: { type: "number", primary: true },
			name: { type: "string" },
		},
	},
]);

try {
	const users = await db.collection("users");
	if (!(await users.get(1))) await users.create({ id: 1, name: "Ada" });
	console.log(await users.get(1)); // { id: 1, name: "Ada" }
} finally {
	await db.close();
}

Run the program again with the same bucket, path, and schema to read the stored document. See the SlateDB object-store guide for supported store URLs.

Store data in Cloudflare R2

This Node.js example uses R2's S3-compatible API. Create an R2 bucket and an API token with Object Read & Write access to that bucket. Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to the token's R2 credentials, and set AWS_DEFAULT_REGION=auto. See Cloudflare's R2 S3 guide for the bucket, token, and account ID setup.

Replace your-account-id and your-bucket-name below. The store URL selects the R2 endpoint and bucket; path places the database under the sorodb-demo prefix in the bucket.

import SoroDB from "sorodb";

const db = SoroDB({
	store: "https://your-account-id.r2.cloudflarestorage.com/your-bucket-name",
	path: "sorodb-demo",
});
db.schema({ version: 1 }, [
	{
		table: "users",
		columns: {
			id: { type: "number", primary: true },
			name: { type: "string" },
		},
	},
]);

try {
	const users = await db.collection("users");
	if (!(await users.get(1))) await users.create({ id: 1, name: "Ada" });
	console.log(await users.get(1)); // { id: 1, name: "Ada" }
} finally {
	await db.close();
}

Run the program again with the same endpoint, bucket, path, and schema to read the stored document. For a bucket in a specific R2 jurisdiction, use its jurisdiction-specific endpoint.

Documentation

Run this repository

bun install --frozen-lockfile
node examples/basic.js
bun run test
bun run typecheck
bun run build:types

The basic example also demonstrates a descending index and async iteration.

License

SoroDB is licensed under the MIT License.