LMDB
Node.js bindings for LMDB, offering a fast embedded key-value store with ACID transactions and zero-copy reads.
Official Documentation ↗v3.0. Check the official docs for the latest API surface.Installation
npm install lmdbMethods
No methods match this filter.
lmdb-js wraps the memory-mapped LMDB engine, giving synchronous and asynchronous access to ordered data.
Key Features
- ACID transactions with reader isolation
- Zero-copy reads of memory-mapped values
- Range queries and duplicate value support
Usage Notes
Pin a version and check the official docs for the API surface you depend on before upgrading.
Errors
The following points are quoted verbatim from the official documentation. 来源:https://cdn.jsdelivr.net/gh/kriszyp/lmdb-js@latest/README.md · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:50:43.644Z. Any error type, throw condition or recovery step not stated there is left unspecified; this page does not infer exception classes or return values.
- The callback may return the exported ABORT constant, or throw an error from the callback, to abort the transaction for this callback. (https://cdn.jsdelivr.net/gh/kriszyp/lmdb-js@latest/README.md)
- It is also critical that when an iteration is finished, the cursor is closed, so by default, if an error occurs during iteration, the cursor will immediately be closed. (https://cdn.jsdelivr.net/gh/kriszyp/lmdb-js@latest/README.md)
- However, if you want to catch errors that occur in map (and flatMap) callbacks during iteration, you can use the mapError method to catch errors that occur during iteration, and allow iteration to continue (without closing the cursor). (https://cdn.jsdelivr.net/gh/kriszyp/lmdb-js@latest/README.md)
FAQ
- How is LMDB different from Level?
- LMDB uses memory-mapped files and MVCC, so reads are often zero-copy and never block writers. Level is a pluggable abstraction over several engines.
- Can I use it from multiple processes?
- Yes. LMDB supports multiple readers and a single writer across processes on the same host, serialized by the OS lock.
- Do values need to be Buffers?
- Not necessarily. lmdb-js serializes objects with its own encoder, and enabling compression stores them more compactly.
Report a problem with this API docOpens a pre-filled issue on GitHub.