all

callback when all callbacks have fired.

npm install all
23 downloads in the last week
122 downloads in the last month

all

callback when all callbacks have fired.

var all = require('all')
var after = all(function () {
  console.log('done')
})

function doSomething(n, cb) {
  setTimeout(function () {
    console.log('N', n)
  }, Math.random() * 100)
}

doSomething(1, cb())
doSomething(2, cb())
doSomething(3, cb())
doSomething(4, cb())

License

MIT

npm loves you