Loop parallelly
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
.npmignore
README.md
index.js
package.json
test.js

README.md

parallel-loop

Async parallel loop. See also: limited-parallel-loop serial-loop

Install

$ npm install parallel-loop

Usage

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