each-series / 1.0.0 last updated 2 years ago created on Mar 14th 2014

Install

npm install --save each-series

Clone

git clone git@github.com:sorribas/each-series.git

dependencies

No dependencies listed.

maintainers

sorribas

versions

1.0.0 2 years ago sorribas
0.2.0 2 years ago sorribas
0.1.0 2 years ago sorribas
782 Downloads yesterday.

readme

each-series

Asynchronously iterate an array as a series. Similar to async.eachSeries, but as a small module.

Installation

Install through npm

npm install each-series

Example

var each = require('each-series');

each([1,2,3,4,5,6,7], function(el, i, done) {
    setTimeout(function() {
        console.log(el);
        done();
    }, 100 - (el * 10));
}, function(err) {
    console.log('Done!');
});

The module is only one function

each(array, iterator, [callback])

The callback is optional.

Error handling

If an error is passed to the done function passed to the iterator, iteration will be stopped and the callback will be invoked with the error.

License

MIT License

Resolving all dependencies.. This could take a while as our cache is not yet fully warmed up.