A TypeScript key-value storage library using JSON files, currently at version 2.7.0. It supports multiple tables, async file operations, and optional encryption. Unlike similar packages (e.g., lowdb, enmap), it offers built-in methods like filter, randomAt, and event-driven readiness via connect. The library is actively maintained with a stable release cadence, and ships TypeScript types.
npm install database-sempaiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a database, adds two entries, retrieves all, finds by value, deletes one, and shows the length.
Use await or .then() for all method calls (set, get, delete, clear, all, etc.).
Pass the table name directly to each method instead of relying on a default table from the constructor.
Use firstKey() and firstValue() methods.
Backup your key. If lost, delete the database files or reinitialize without encryption.
Set extname to '.json' explicitly to avoid confusion.
Use 'get' to check if a key exists, or 'keys' to list all keys.
Add await before the method call, e.g., await db.set(...)
Add the table name to the 'table' array in the constructor, or use 'set' method which creates the table implicitly.
Provide the exact same key used during encryption via the 'key' option in the constructor.
Use one of the supported extensions: '.json', '.sql', or '.txt' (though .sql is misleading, use .json).
No dependency data recorded yet.