JSPM

level-writestream

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 17
  • Score
    100M100P100Q44372F
  • License MIT

LevelUP Write Stream compatible with streams2

Package Exports

  • level-writestream

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (level-writestream) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

level-writestream

Streams2-compliant write stream for LevelDB

Install

$ npm i level-writestream --save

(also install level if you haven't already:

$ npm i level --save

)

Import

var LevelWriteStream = require('level-writestream');

Apply

var db = level('/path/to/level/db/dir');
LevelWriteStream(db);

Use

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.

Benchmark

$ cd tests/benchmarks
$ ./run

License

MIT