An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

# each-parallel-async [![NPM version](https://img.shields.io/npm/v/each-parallel-async.svg?style=flat)](https://www.npmjs.com/package/each-parallel-async) [![NPM monthly downloads](https://img.shields.io/npm/dm/each-parallel-async.svg?style=flat)](https://npmjs.org/package/each-parallel-async) [![NPM total downloads](https://img.shields.io/npm/dt/each-parallel-async.svg?style=flat)](https://npmjs.org/package/each-parallel-async) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/each-parallel-async.svg?style=flat&label=Travis)](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._