Skip to content

sorribas/each-series

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Asynchronously iterate an array as a series in Node.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published