API Reference

lowdb

Tiny local JSON database for Node.js and the browser, backed by pluggable adapters and powered by lodash.

Official Documentation ↗
CompatibilityThis documentation covers version v7. Check the official docs for the latest API surface.

Installation

npmnpm install lowdb

Methods

lowdb loads a whole JSON document into memory, lets you mutate it with lodash chains, and writes it back.

Key Features

  • JSONFile and Memory adapters
  • Chainable lodash queries on db.data
  • Tiny footprint with no native deps

Usage Notes

Pin a version and check the official docs for the API surface you depend on before upgrading.

Security notes

Quoted verbatim from the official documentation; this is not a complete threat model. 来源:https://cdn.jsdelivr.net/gh/typicode/lowdb@latest/README.md · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:50:46.019Z.

FAQ

Is lowdb suitable for large datasets?
No. It loads the entire document into memory and rewrites the file on every write, so it fits configuration and small local data only.
How do I query data?
db.data is a plain object, so use lodash. The lodash chain is available through lowdb for chained operations.
Can I use it in the browser?
Yes. Use the Memory adapter or localStorage adapter; the JSON file adapter is Node-only.