parallel-loop
v3.0.0
Published
Loop parallelly
Downloads
1,804
Readme
parallel-loop
Async parallel loop.
Install
#NPM
npm install parallel-loop --save
#YARN
yarn add parallel-loop
Usage
const loop = require('parallel-loop')
loop(10, each, function () {
console.log('end')
})
function each (done, i) {
setTimeout(function () {
console.log(i)
done()
}, Math.floor(Math.random() * 500))
})
Will output:
3
9
2
5
7
4
1
8
6
end