level-writestream

LevelUP Write Stream compatible with streams2

level-writestream

Streams2-compliant write stream for LevelDB

$ npm i level-writestream --save

(also install level if you haven't already:

$ npm i level --save

)

var LevelWriteStream = require('level-writestream');
var db = level('/path/to/level/db/dir');
LevelWriteStream(db);
var ws = db.createWriteStream();
ws.write({key: 'A', value: 'B'}, function(err) {
  if (err) throw err;
});
 
source.pipe(ws);
 
ws.once('finish', function() {
  console.log('finished');
});

You can use the same options as in the LevelUP API plus all the streams2 API conventions.

$ tests/benchmarks/old/run
$ cd tests/benchmarks
$ ./run

MIT