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

@n-dimension-database-ndb/client

v2.4.0

Published

Thin typed client for the nDB wire protocol v1 — n-dimensional database. Zero dependencies; Node, browser, Deno, edge.

Downloads

301

Readme

@n-dimension-database-ndb/client

Thin, typed TypeScript client for the nDB wire protocol v1. Zero runtime dependencies. Runs anywhere fetch exists — Node ≥18, browsers, Deno, and edge runtimes.

It mirrors the Rust client surface and targets the /v1 HTTP API documented in docs/PROTOCOL.md. Data-durability and upgrade guarantees: docs/COMPATIBILITY.md.

Install

npm i @n-dimension-database-ndb/client

Use

import { NdbClient } from "@n-dimension-database-ndb/client";

const db = new NdbClient("http://127.0.0.1:8742", {
  token: process.env.NDB_TOKEN, // optional bearer token
  retries: 3,                   // GET retries fully; writes retry connection-only
});

// Liveness
console.log((await db.health()).status); // "ok"

// Write a record (see docs/PROTOCOL.md for the record shape)
const { tx_id } = await db.commit({
  records: [{
    kind: "entity",
    entity_id: crypto.randomUUID(),
    type_id: 1,
    tx_id_assert: 0,
    tx_id_supersede: "active",
    properties: [{ prop_id: 10, value: { tag: "string", value: "[email protected]" } }],
  }],
});

// Read it back
const r = await db.read("…uuid…");        // { outcome: "live", record: {…} }

// Query by source text (the server parses + resolves names)
const res = await db.queryText("match customer(name: ?n) return ?n limit 10");
console.log(res.columns, res.rows);

// Walk all records at a snapshot (server streams JSONL → parsed to an array)
for (const rec of await db.iter()) { /* … */ }

API

Reads: health(), read(uuid), iter({snapshot?}), query(req), queryText(text), lookup(req), vectorSearch(req), propertyLookup(req), propertyRange(req), traverse(req). Writes: commit(req), flush(), compact().

Errors are thrown as NdbError with .status, .code, and .message.

Retry semantics

Matching the Rust client: GET requests retry on transport errors and 502/503/504 responses; writes retry only when the connection failed before any response arrived — so a commit is never applied twice.

Develop

npm run typecheck
cargo build -p ndb-server      # the integration test spawns this binary
npm test                       # spawns ndb-server, exercises the client over /v1
npm run build                  # → dist/

Set NDB_SERVER_BIN to point the test at a specific server binary; it defaults to target/debug/ndb-server at the repo root.

License

MIT