# bkjs-lmdb

> LMDB support for node.js and backendjs

Latest version **0.1.2** (published 2016-03-09) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install bkjs-lmdb
pnpm add bkjs-lmdb
yarn add bkjs-lmdb
bun add bkjs-lmdb
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2016-03-09 |
| First published | 2015-10-15 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 0 |
| Author | Vlad Seryakov |
| Maintainers | veryakov |

## Links

- npm: https://www.npmjs.com/package/bkjs-lmdb
- Repository: https://github.com/vseryakov/bkjs-lmdb
- Homepage: https://github.com/vseryakov/backendjs
- Issues: https://github.com/vseryakov/bkjs-lmdb/issues
- npm.io page: https://npm.io/package/bkjs-lmdb

## Dependencies (1)

- [nan](https://npm.io/package/nan.md) >= 2.0.9

## Recent versions

- 0.1.2 (latest) — 2016-03-09
- 0.1.0 — 2015-10-15

## README

# LMDB module for node and backendjs

# Usage

```javascript
  var lmdb = require("bkjs-lmb");
  var env = new bklmdb.Env({ path: "/tmp" });
  var db = new lmdb.Database(env, { name: "test", flags: lmdb.MDB_CREATE }, function(err) {

     this.put("key1", "value1");
     this.put("key2", "value2");
     this.select("key", "key", { begins_with: 1 }, function(err, rows) {
       console.log(rows);
     });

  });
```

## Env class
 - `new Env(options)` - create new environment
 - The options properties:
   - path - the database file path
   - flags - bitmask of LMDB_ flags
   - dbs - number of databases
## Database class
- `new Database(env, options, callback)` - create new database object
- Properties:
  - open - 1 if the db is open
  - name - the database file name
- Methods:
  - close - close the database
  - drop - drop the database file
  - get(key, callback) - return value for the given key
  - put(key, value [, flags] [, callback]) - store a value for the given key
  - incr(key, num [, flags] [, callback]) - increment a value by a number
  - del(key [, value] [,callback]) - delete a key
  - select(start, end [,flags] [, callback]) - return list of matching records
    The flags are:
     - desc - 1 to return in descendent order
     - begins_with - 1 if match by beginning of the start key
     - count - number of records to return

# Author

Vlad Seryakov

---
_Source: https://npm.io/package/bkjs-lmdb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
