batchlevel
batch an entire leveldb database
Last updated 2 years ago by juul .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install batchlevel 
SYNC missed versions from official npm registry.

Like .batch() but for all operations on a levelup database.

This lets you batch operations across multiple sublevels:

var memdb = require('memdb');
var sublevel = require('subleveldown');
var batchlevel = require('batchlevel');

var mydb = memdb();
var db = batchlevel(mydb); // batch entire db

var idb = sublevel(db, 'i'); // index
var rdb = sublevel(db, 'r'); // reverse index

idb.put('foo', 'bar', function(err) {
  if(err) return console.error(err);

  rdb.put('bar', 'foo', function(err) {
    if(err) return console.error(err);

    db.write(function(err) {
      if(err) return console.error(err);

      console.log("Wrote changes to database");
    }); 
  });
});

License and copyright

License: Apache License 2.0

Copyright 2017 BioBricks Foundation

Current Tags

  • 0.0.2                                ...           latest (2 years ago)

2 Versions

  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (3)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |