Member-only story
A Real Database, Zero Dependencies: Node’s Built-In SQLite
Not a Medium member? Read this article here
better-sqlite3 has been the default answer for a local, embedded database in Node for years, and it comes with a real cost most people have just accepted: it's a native addon, compiled C bindings, which means prebuilt binaries that have to match your exact OS, architecture, and Node version, or a local compile step that occasionally fails in exactly the environment you least expect it to, a CI runner, a Docker build stage, an M-series Mac. node:sqlite, built directly into Node since 22.5 and stabilized in Node 24, removes that dependency entirely.
What It Actually Looks Like
import { DatabaseSync } from "node:sqlite";
const db = new DatabaseSync("app.db");
db.exec(`
CREATE TABLE IF NOT EXISTS tasks (
id INTEGER PRIMARY KEY,
title TEXT NOT NULL,
completed INTEGER DEFAULT 0
)
`);
const insert = db.prepare("INSERT INTO tasks (title) VALUES (?)");
insert.run("Write the quarterly report");
const tasks = db.prepare("SELECT * FROM tasks").all();
console.log(tasks); // [{ id: 1, title: 'Write the quarterly report', completed: 0 }]
db.close();No npm install, no native compilation step, no prebuilt binary to match against your platform, this is part of the standard library now, the same way fs or…










