https://github.com/jonschlinkert/each-parallel-async
Asynchronously calls a function on each element in an array in parallel.
https://github.com/jonschlinkert/each-parallel-async
async each javascript nodejs parallel
Last synced: 8 months ago
JSON representation
Asynchronously calls a function on each element in an array in parallel.
- Host: GitHub
- URL: https://github.com/jonschlinkert/each-parallel-async
- Owner: jonschlinkert
- License: mit
- Created: 2017-09-11T02:25:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-11T02:28:27.000Z (over 8 years ago)
- Last Synced: 2025-04-21T16:48:22.212Z (9 months ago)
- Topics: async, each, javascript, nodejs, parallel
- Language: JavaScript
- Homepage: https://github.com/jonschlinkert
- Size: 4.88 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# each-parallel-async [](https://www.npmjs.com/package/each-parallel-async) [](https://npmjs.org/package/each-parallel-async) [](https://npmjs.org/package/each-parallel-async) [](https://travis-ci.org/jonschlinkert/each-parallel-async)
> Asynchronously calls a function on each element in an array in parallel.
Follow this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), for updates on this project and others.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save each-parallel-async
```
## Usage
```js
var each = require('each-parallel-async');
var result = [];
each([1, 2, 3, 4, 5, 6], function(ele, next) {
result.push(ele * (i + 1));
next();
}, function (err) {
console.log(result);
//=> [ 1, 4, 9, 16, 25, 36 ]
});
```
**Params**
* `array` **{Array}** - (required) Array of elements to loop over
* `next` **{Function}** - (required) Function to call on each element in the array
* `callback` **{Function}** - (required) Final callback function, called after `next` is called on each element in the array.
## About
### Related projects
You might also be interested in these projects:
* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays.")
* [arr-reduce](https://www.npmjs.com/package/arr-reduce): Fast array reduce that also loops over sparse elements. | [homepage](https://github.com/jonschlinkert/arr-reduce "Fast array reduce that also loops over sparse elements.")
* [array-unique](https://www.npmjs.com/package/array-unique): Remove duplicate values from an array. Fastest ES5 implementation. | [homepage](https://github.com/jonschlinkert/array-unique "Remove duplicate values from an array. Fastest ES5 implementation.")
* [async-array-reduce](https://www.npmjs.com/package/async-array-reduce): Async array reduce. Asynchronously applies a function against an accumulator and each element in an… [more](https://github.com/jonschlinkert/async-array-reduce) | [homepage](https://github.com/jonschlinkert/async-array-reduce "Async array reduce. Asynchronously applies a function against an accumulator and each element in an array (from left to right, in series) to reduce it to a single value.")
* [each-series-async](https://www.npmjs.com/package/each-series-async): Asynchronously calls a function on each element in an array in series. | [homepage](https://github.com/jonschlinkert/each-series-async "Asynchronously calls a function on each element in an array in series.")
### Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
### Building docs
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
To generate the readme, run the following command:
```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```
### Running tests
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
$ npm install && npm test
```
### Author
**Jon Schlinkert**
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
### License
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on September 10, 2017._