Socket
Socket
Sign inDemoInstall

lmdb

Package Overview
Dependencies
Maintainers
3
Versions
171
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lmdb

Simple, efficient, scalable data store wrapper for LMDB


Version published
Weekly downloads
1.5M
increased by2.05%
Maintainers
3
Weekly downloads
 
Created

What is lmdb?

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.

What are lmdb's main functionalities?

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);
}

Other packages similar to lmdb

Keywords

FAQs

Package last updated on 04 Nov 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc