better-sqlite3 is a high-performance SQLite3 client for Node.js that executes queries synchronously, returning results directly without callbacks or promises. It compiles as a native addon using N-API, binding directly to the SQLite3 C library for immediate query execution and zero-copy result serialization into native JavaScript objects.
The library is optimized for Write-Ahead Logging (WAL) mode, enabling faster concurrent reads and writes in web applications. It provides durability level tuning through the synchronous pragma, allowing adjustments between FULL, NORMAL, and OFF modes to balance write performance against crash safety. The library also includes checkpoint starvation prevention, monitoring WAL file growth and triggering forced checkpoints to prevent unbounded disk usage during high-write workloads.
The project handles multi-gigabyte databases efficiently with proper indexing and joins, and its synchronous API eliminates callback overhead and promise wrappers for straightforward query execution.