async-each-loop
Usage
Install
First install the library with npm
or yarn
:
$ npm i -S async-each-loop
or
$ yarn add async-each-loop
Usage
- With
async/await
:
const parallelForEach = ; const urls = 'https://github.com' 'https://circleci.com/'; const run = async { await ; console;}; ;
- With
Promnise
:
const parallelForEach = ; const urls = 'https://github.com' 'https://circleci.com/'; ;
API
parallelForEach (iterable, fn)
This function execute the input function fn
forEach element of the input iterable
. The forEach is running over the elements in parallel.
- iterable is an Array or Map
- fn is a function
sequenceForEach (iterable, fn)
This function execute the input function fn
forEach element of the input iterable
. The execution is in sequence, each function is invoked after the end of the previous element.
- iterable is an Array or Map
- fn is a function
Contributing
Anyone and everyone is welcome to contribute.
Issues
Find a bug or want to request a new feature? Please let me know by submitting an issue.
Licensing
Licensed under the MIT License
A copy of the license is available in the repository's LICENSE file.