Syndicode recently found an interesting open source library in Node.js called better-sqlite3. There are several reasons why you should use it instead of node-sqlite3. Consider this new fast and simple library for SQLite3 in Node.js.
Ok, here we are, between something we already know and use and something we just found.
better-sqlite3 looks quite attractive:
- Full transaction support
- Geared for performance, efficiency, and safety
- Easy-to-use synchronous API (faster than an asynchronous API)
- Custom SQL function support
- 64-bit integer support (invisible until you need it)
But still, why should you replace your node-sqlite3 with it? Here are the bunch of reasons:
- node-sqlite3 uses asynchronous APIs for tasks that are either CPU-bound or serialized.
- node-sqlite3 exposes low-level (C language) memory management functions.
- better-sqlite3 is simpler to use, and it provides nice utilities for some operations that are very difficult or impossible in node-sqlite3.
- better-sqlite3 is much faster than node-sqlite3 in most cases, and just as fast in all other cases.
Desition is yours! Find the details on GitHub.
Check our JS digests to find more about interesting open source JS projects!