Dependency free async each, map, and reduce written in ES6 package for Node.js
npm install async-each-map





Efficient, light wegith, dependency free NPM package for doing asyncronous each,
map, and reduce operations in Node.js.
* Node.JS >= v4.0.0
```
$ npm install async-each-map --save
`js`
const each = require('async-each-map');
Applies the iterator function to each item in array, in sequence and initerator
order. The is called with an item from the list, and a nextiterator
function for when it has finished. If the passes an error to thenext function, the callback is immediately called with the error.
#### Arguments
* array - An array to iterate over.iterator(item, next)
* - A function to apply to each item in arr. The iteratorcallback(error, array)
is passed a callback(err) which must be called once it has completed. If no
error has occurred, the callback should be run without arguments or with an
explicit null argument. The array index is not passed to the iterator.
- Optional* A callback which is called when all
iterator functions have finished, or an error occurs. When using the map
functionality a second parameter is provided.
#### Examples
`js
each([3, 6, 2, 9], (item, next) => {
some.async.operation(item, error => {
next(error);
});
}, error => {
if (error) { throw error; }
console.log('Done!');
});
`
`js
each(['/some/file1', '/some/file2', '/some/file3'], fs.readFile, (error, files) => {
if (error) { throw error; }
for (const content in files) {
console.log(content);
}
})
`
`js
each(['/some/file1', '/some/file2', '/some/file3'], fs.exists, (error, files) => {
if (error) { throw error; }
for (const file in files) {
console.log(${file} exists);``
}
});