levelup-iterator

an iterator for node-levelup

npm install levelup-iterator
1 downloads in the last week
5 downloads in the last month

levelup-iterator

Use the async iterator pattern used in LevelDown in LevelUp.

Async iterators can conveniently used with the async-iterators library.

var levelup = require('levelup')
var createIterator = require('levelup-iterator')
var iterators = require('async-iterators')

var db = levelup('test')

var iterator = createIterator(db, {start: 'b'})

iterators.forEach(iterator, function(err, entry) {
  console.log(entry)
}, function() {
  console.log('end')
})

You can pass in all options to createIterator(db, [options]) that are used in LevelUp's db.createReadStream([options]).

npm loves you