Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
The lmdb npm package is a Node.js binding for the Lightning Memory-Mapped Database (LMDB). LMDB is a fast, compact, and powerful embedded data store. The lmdb package allows Node.js applications to store and retrieve data in a high-performance and transactional database environment.
Key-Value Store
LMDB provides a simple key-value store where you can save and retrieve data using keys.
const { open } = require('lmdb');
const db = open({ path: './mydata' });
db.put('key', 'value');
const value = db.get('key');
console.log(value); // 'value'
Transactions
LMDB supports transactions, allowing multiple operations to be performed atomically.
const { open } = require('lmdb');
const db = open({ path: './mydata' });
db.transaction(() => {
db.put('key1', 'value1');
db.put('key2', 'value2');
});
Multiple Databases
LMDB allows you to create multiple databases within the same environment.
const { open } = require('lmdb');
const env = open({ path: './mydata' });
const db1 = env.openDbi({ name: 'db1', create: true });
const db2 = env.openDbi({ name: 'db2', create: true });
db1.put('key', 'value1');
db2.put('key', 'value2');
Dupsort
LMDB supports sorted duplicate keys, allowing multiple values per key, sorted by value.
const { open } = require('lmdb');
const db = open({ path: './mydata', dupSort: true });
db.put('key', 'value1');
db.put('key', 'value2');
const values = db.getRange({ start: 'key' });
for (const { key, value } of values) {
console.log(key, value);
}
Level is a fast and simple storage. A Node.js-style LevelDB wrapper that is used for persistent or ephemeral key-value data. It differs from lmdb in that it's built on top of LevelDB and has a different API, but it provides similar key-value store capabilities.
RocksDB is a high performance embedded database for key-value data. It is a fork of LevelDB by Facebook optimized for fast storage. RocksDB provides similar functionality to lmdb but with different performance characteristics and additional features like column families.
NeDB is a lightweight JavaScript database using a subset of MongoDB's API. It's an in-memory database with persistence to disk. Unlike lmdb, NeDB is not a key-value store but a document database, which can be more suitable for complex data structures.
FAQs
Simple, efficient, scalable, high-performance LMDB interface
The npm package lmdb receives a total of 1,185,731 weekly downloads. As such, lmdb popularity was classified as popular.
We found that lmdb demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.