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

@visorcraft/mongreldb

v0.51.0

Published

High-performance Node.js bindings for MongrelDB with native in-process storage, sub-ms writes, and hybrid indexing.

Readme

mongreldb-node

High-performance Node.js bindings for MongrelDB via NAPI, with native in-process storage, sub-ms writes, and hybrid indexing. It follows the better-sqlite3 model: no HTTP latency, so the ~8 µs single-row write isn't dwarfed by a network round-trip. Exposes a typed object/method interface (not SQL); TypeScript types are generated at build time.

This crate is built separately from the Rust workspace (it targets the NAPI ABI and needs Node.js tooling). It is excluded from cargo {test,clippy} --workspace.

Build

Requires Node.js ≥ 16 and @napi-rs/cli:

cd crates/mongreldb-node
npm install
npm run build          # → mongreldb.<platform>.node + index.d.ts

API sketch (generated index.d.ts)

class Database {
  static withPath(path: string): Database
  static open(path: string): Database
  createTable(name: string, schema: SchemaSpec): bigint
  table(name: string): TableHandle
  begin(): Transaction
  createProcedure(spec: ProcedureSpec): bigint
  createOrReplaceProcedure(spec: ProcedureSpec): bigint
  dropProcedure(name: string): void
  procedures(): ProcedureInfo[]
  procedure(name: string): ProcedureInfo | null
  callProcedure(name: string, opts?: ProcedureCallOptions): ProcedureCallResult
  callProcedureAsync(name: string, opts?: ProcedureCallOptions): Promise<ProcedureCallResult>
  sql(sql: string): Promise<Buffer>
  close(): void
}

class TableHandle {
  put(cells: Cell[]): PutResult
  putBatch(rows: Cell[][]): PutResult[]
  bulkLoadTyped(columns: TypedColumn[]): bigint
  commit(): bigint
  flush(): bigint
  count(): bigint                        // O(1)
  countWhere(conditions: ConditionSpec[]): bigint
  get(rowId: bigint): RowJs | null
  query(conditions: ConditionSpec[]): RowJs[]   // hybrid: bitmap ∩ range ∩ FM ∩ HNSW
  queryArrow(conditions: ConditionSpec[]): Buffer
}

Hybrid query - the differentiator

query intersects row-id sets from any combination of the six index types in a single in-process call - something no HTTP vector DB or SQL FTS pipeline can do in one hop:

db.query([
  { kind: ConditionKind.Ann, columnId: 5, embedding: queryVec, k: 50 },
  { kind: ConditionKind.FmContains, columnId: 2, text: "rome" },
  { kind: ConditionKind.BitmapIn, columnId: 3, values: ["eu", "na"] },
])

Notes

  • Row ids / counts / epochs cross the FFI as JS BigInt (u64), so the full 64-bit id space is lossless.
  • Most blocking table methods also expose *Async Promise variants that run on the NAPI blocking pool.