1.0.2 • Published 11 months ago

poziomka v1.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
11 months ago

NPM version Build Status Dependency Status Dev Dependency Status

poziomka

Fast and opinionated leveldb interface.

  • It does not support any encoding (works with buffers).
  • It allows for fast insertion and lookup through putMany and getMany

If you need encoding, iteration and other goodies check out level.

Install

$ npm install --save poziomka

Usage

var Poziomka = require('poziomka');

let db = new Poziomka('/path/to/my/db');

// no encoding/decoding - poziomka works with Buffers
let keys = [2, 3, 4].map(x => Buffer.from([x]));

db.open(function(err) {
  if (err) {
    // something went wrong
  }
  // database is not open
});

// keys and values have to be Arrays of Buffer's
db.putMany(keys, values, function(err) {
  // for each key in an
});


// keys and values have to be Arrays of Buffer's
db.getMany(keys, function(err, values, missing) {
  if (err) {
    // leveldb error
  }
  if (missing) {
    // some of the keys were not in DB
    // missing has indexes in the keys array, so to print the keys
    console.log('Missing keys:', missing.map(i => keys[i]));
  }
  // empty Buffer is returned for each missing key
});

db.removeMany(keys, function(err) {
  // keys are now deleted
});

License

MIT © Damian Krzeminski

1.0.2

11 months ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago