async-iterators
v0.2.2
Published
utility functions for async iterators
Downloads
15,884
Readme
#async-iterators Utility functions for async iterators in Node.js.
An async iterator is an object with a next(cb)
method.
Invoking the method will return the next item of an underlying data source.
This library gives you some useful functions like forEach
and map
for iterators:
var iterators = require('async-iterators')
iterators.forEach(someIterator, function(err, data) {
console.log(data)
}, function() {
console.log('end')
})
Some libraries using the async iterator pattern:
- stream-iterator - wrap any stream into an async iterator
- node-leveldown - allows you to iterate over entries in LevelDB
##License MIT