better-sqlite3
npmv13.0.3The fastest and simplest library for SQLite in Node.js.
Safe to adopt
Yes — better-sqlite3 scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 36 days ago. 31 releases in the last 2 years.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- AMaintenance: grade A, Excellent.
Last published 36 days ago. 31 releases in the last 2 years.
- AWeight: grade A, Excellent.
Pulls in 1 transitive package, about 26 MB installed (at least — some of the tree is still being crawled).
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding better-sqlite3 to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Part of this dependency tree has not been crawled yet, so these figures are a lower bound rather than a final total.
Compatibility
- Node.js
- node >=22
- Module format
- CommonJS only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the better-sqlite3 README.
const db = require('better-sqlite3')('foobar.db', options);
const row = db.prepare('SELECT * FROM users WHERE id = ?').get(userId);
console.log(row.firstName, row.lastName, row.email);better-sqlite3 vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| better-sqlite3this page | 0 | 5 | MIT | 1 month ago |
| sqlite3 | 0 | 3 | BSD-3-Clause | 1 day ago |
| drizzle-orm | 19M | 0 | Apache-2.0 | 1 day ago |
| knex | 0 | 1 | MIT | 1 day ago |
| kysely | 15.6M | 1 | MIT | 1 day ago |
| @libsql/client | 2M | 1 | MIT | 1 day ago |
Dependencies
Declared by better-sqlite3 v13.0.3. Runtime dependencies are installed with the package; dev dependencies are not.
Runtime (1)
Dev (8)
Used by
Popular packages that depend on better-sqlite3.
Drizzle ORM package for SQL databases
Type safe SQL query builder
Fastest SQLite for React Native (with node.js support)
Provides access to a database using SQLite (https://www.sqlite.org/). The database is persisted across restarts of your app.
A batteries-included SQL query & schema builder for PostgresSQL, MySQL, CockroachDB, MSSQL and SQLite3
Relationship graph
Dependencies (left) and dependents (right) of better-sqlite3.
Frequently installed together
React is a JavaScript library for building user interfaces.
A framework for building native apps using React
SQLite Wasm conveniently wrapped as an ES Module.
TypeScript definitions for better-sqlite3
Delightful JavaScript Testing.
TypeScript definitions for node
PostgreSQL client - pure javascript & libpq with the same API
fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS
TypeScript definitions for pg
PGlite is a WASM Postgres build packaged into a TypeScript client library that enables you to run Postgres in the browser, Node.js and Bun, with no need to install any other dependencies. It is only 3.7mb gzipped.
The Expo SDK
Prettier is an opinionated code formatter
Release history
27 releases in the last two years, typically about 7 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 13.0.3latest | 1 month ago | 26 MB | MIT |
| 13.0.2 | 1 month ago | 26 MB | MIT |
| 13.0.1 | 1 month ago | 26 MB | MIT |
| 13.0.0 | 1 month ago | 26 MB | MIT |
| 12.11.1 | 2 months ago | 9.9 MB | MIT |
| 12.10.1 | 2 months ago | 9.9 MB | MIT |
| 12.10.0 | 4 months ago | 9.9 MB | MIT |
| 12.9.0 | 5 months ago | 9.9 MB | MIT |
| 12.8.0 | 6 months ago | 9.8 MB | MIT |
| 12.6.2 | 7 months ago | 9.8 MB | MIT |
| 12.6.0 | 8 months ago | 9.8 MB | MIT |
| 12.5.0 | 9 months ago | 9.8 MB | MIT |
| 12.4.6 | 9 months ago | 9.8 MB | MIT |
| 12.4.5 | 9 months ago | 9.8 MB | MIT |
| 12.4.1 | 11 months ago | 9.7 MB | MIT |
Overview
better-sqlite3 is an npm package that the fastest and simplest library for SQLite in Node.js. It has 5 known dependents in the graph. The latest version is 13.0.3, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need the fastest and simplest library for SQLite in Node.js and value a focused solution.
When not to use it
Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Clear open-source license (MIT).
Cons
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use better-sqlite3?
Yes — better-sqlite3 scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 36 days ago. 31 releases in the last 2 years.
How do I install better-sqlite3?
Run `npm install better-sqlite3` to add better-sqlite3 to your npm project.
How many dependencies does better-sqlite3 have?
better-sqlite3 declares 9 direct dependencies and pulls in 1 packages in total once its runtime tree is resolved totalling about 26 MB on disk.
What license is better-sqlite3 released under?
better-sqlite3 is distributed under the MIT license.
How popular is better-sqlite3?
npm does not publish download counts. Within PackageGraph's crawl, 5 known packages depend on better-sqlite3.
Is better-sqlite3 still maintained?
The most recent release of better-sqlite3 (v13.0.3) was published 1 month ago.
Does better-sqlite3 run install scripts?
No. better-sqlite3 does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.