better-sqlite3
The fastest and simplest SQLite3 library for Node.js, with a synchronous API and full transaction support.
Repository Health
Technical Analysis
better-sqlite3 is a high-performance SQLite3 binding for Node.js that exposes a deliberately synchronous API. Instead of forcing callbacks or promises onto operations that are CPU-bound and serialized by SQLite anyway, it lets you prepare statements and read rows inline, which is both simpler to reason about and measurably faster than asynchronous alternatives.
Built on a native C++ addon that embeds SQLite directly, it delivers full transaction support, user-defined functions, aggregates, virtual tables, 64-bit integers, and worker-thread support. Prebuilt binaries ship for supported Node.js LTS versions, so most projects can install and query a database in a couple of lines.
What You Get
- A synchronous prepared-statement API with get(), all(), iterate(), and run() for reading and writing rows without callbacks or promises
- Full transaction support via db.transaction(), including nested savepoints and automatic rollback on error
- Extensibility hooks for user-defined functions, aggregates, virtual tables, and loadable extensions
- First-class 64-bit integer handling, opt-in per statement or database-wide
- Prebuilt native binaries for supported Node.js LTS versions, plus worker-thread support for large or slow queries
Common Use Cases
- Embedding a fast local database in desktop, CLI, or Electron applications
- Powering server-side caches, queues, or read-heavy stores where an embedded database beats a network round-trip
- Running data-import, ETL, or migration scripts that need tight synchronous control over transactions
- Backing test suites and prototypes with an in-memory SQLite database
Under The Hood
Architecture - better-sqlite3 is a thin, well-factored JavaScript layer (lib/database.js and lib/methods/*.js) sitting on top of a native C++ addon (src/objects/database.cpp, statement.cpp, backup.cpp) that embeds SQLite from deps/. The Database constructor validates options, lazily loads the compiled better_sqlite3.node binding via the bindings package, and wires prototype methods (prepare, transaction, pragma, backup, function, aggregate, table) onto each instance; a hidden cppdb symbol holds the native handle so calls like prepare().get() drop straight into C++ for execution.
Tech Stack - The library targets Node.js 20 through 26 and ships as JavaScript (~68%) over C++ (~32%). Runtime dependencies are minimal: bindings for locating the addon and prebuild-install to fetch prebuilt binaries, falling back to node-gyp rebuild through binding.gyp when none match. Testing and benchmarking use mocha, chai, nodemark, and the competing sqlite/sqlite3 packages for comparison.
Code Quality - The repo carries a substantial mocha suite of roughly thirty numbered test files covering database open/close, pragmas, statement run/get/all/iterate, transactions, and error cases. Input validation is thorough and defensive: the constructor throws precise TypeError/RangeError messages for misspelled or removed options, and errors surface through a dedicated SqliteError class. Naming is consistent and the small util module keeps shared symbols and option parsing centralized.
API Design - The public surface is deliberately minimal and ergonomic: new Database(path) then prepare(sql) returning a statement with get/all/iterate/run keeps boilerplate near zero, and the synchronous model removes the callback nesting other bindings require. Extensive docs (api.md plus dedicated performance, integer, threads, and troubleshooting guides) and clear README examples make the learning curve gentle for anyone who already knows SQL.
Used by 40 apps in this directory
Pangolin
Networking
An open-source, identity-based zero-trust remote access platform built on WireGuard — a self-hostable alternative to Cloudflare Tunnel and Twingate with SSO, OIDC, and tunneled reverse proxying.
Payload CMS
Blogging · CMS · Developer Tools
The open-source, Next.js-native headless CMS that lives inside your /app folder and gives you a full TypeScript backend instantly.
Arize Phoenix
Analytics · Devops · Monitoring
Open-source AI observability platform for tracing, evaluating, and debugging LLM applications with built-in intelligence and MCP support.
Puter
Developer Tools · File Storage
A self-hostable, web-based internet OS with desktop GUI, cloud storage, AI drivers, and a developer SDK — all running in your browser.
RelayPlane
AI Agents
An npm-native, drop-in LLM proxy for Node.js — swap in as your OpenAI/Anthropic base URL to get per-request cost tracking, task-aware routing, budget enforcement, and anomaly detection running locally, for free.
Silex
Design Tools · No Code Platforms
Free, open-source visual website builder that exports clean HTML/CSS — no lock-in, no subscription, host anywhere
Skrun
AI Agents
An open, self-hostable, multi-model agent runtime that deploys any agent skill as an API via POST /run — an open-source alternative to Claude Managed Agents and Google's Gemini Enterprise Agent Platform.
strapi
CMS
Open-source headless CMS that auto-generates REST and GraphQL APIs from your content models, with a fully customizable admin panel you control.
superset
AI Code Assistants · AI Development
Orchestrate an army of AI coding agents—Claude Code, Codex, Gemini CLI, and more—running simultaneously in isolated git worktrees from a single Electron desktop app.