Home

Awesome

#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]).