This repository has been archived on 2026-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
todo/node_modules/all
2025-06-13 14:04:40 +08:00
..
.npmignore Initial commit 2025-06-13 14:04:40 +08:00
.travis.yml Initial commit 2025-06-13 14:04:40 +08:00
example.js Initial commit 2025-06-13 14:04:40 +08:00
index.js Initial commit 2025-06-13 14:04:40 +08:00
LICENSE Initial commit 2025-06-13 14:04:40 +08:00
package.json Initial commit 2025-06-13 14:04:40 +08:00
README.md Initial commit 2025-06-13 14:04:40 +08:00

all

callback when all callbacks have fired.

<img src=https://secure.travis-ci.org/dominictarr/all.png?branch=master>

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