Lowdb stores and updates JSON documents in files or browser storage with plain JavaScript objects and optional TypeScript typing.
Overview
Lowdb is a small embedded database for JavaScript applications. You read a JSON store into memory, mutate db.data with normal object and array code, then persist changes through write calls.
Presets cover async and sync JSON files, plus localStorage and sessionStorage adapters in the browser. Lower-level adapter classes let you swap storage backends, encryption, or serialization formats such as YAML via custom adapters built on text or data file helpers.
The API exposes read, write, and update helpers with atomic write safety noted in the documentation. In tests, file adapters can fall back to fast in-memory mode automatically. Lodash or similar libraries can extend query helpers when you avoid the default JSON preset.
Documentation warns that very large objects can slow writes because each save stringifies the whole document, and that clustered Node workloads are unsupported, pointing heavy deployments toward external databases instead.
Key features
- In-memory JSON document store
- JSON file async and sync adapters
- Browser localStorage adapters
- TypeScript-friendly typing
- Atomic write safety
- Pluggable custom adapters
- Memory mode for unit tests
- Lodash-friendly extension pattern
Use cases
- Persist small app config to JSON files
- Prototype Node services without a server DB
- Store UI state in browser storage
- Embed lightweight data in Electron tools