Socket
Socket
Sign inDemoInstall

lmdb

Package Overview
Dependencies
1
Maintainers
1
Versions
168
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lmdb

nothing to see here yet, please move along


Version published
Maintainers
1
Created

Package description

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

FAQs

Last updated on 29 Jun 2013

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc