async-iterator

A Standard API for LevelDOWN style Iterator.

async-iterator

A Standard API for LevelDOWN style Iterator.

Stability

Unstable: Expect patches and features, possible api changes.

var Iterator = require('async-iterator')
 
var it = Iterator(function get (i, cb) {
  //retrive the Ith item.
}, function end (cb) {
  //drop everthing! iterator is no longer needed!
})

Get the next item.

Will error if:

  • you are already retriving an item, but the callback has not yet been called.
  • the Iterator has ended.

Dispose of the Iterator. If you have called Iterator#next but it has not called back yet, then the end call will be queued until it has.

MIT