Comparing version 2.0.1 to 2.0.2
{ | ||
"name": "after-all", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Execute several async functions and get a callback when they are all done", | ||
@@ -11,3 +11,4 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "tape test" | ||
"test": "tape test", | ||
"sauce": "node test/sauce.js" | ||
}, | ||
@@ -17,2 +18,3 @@ "author": "Eduardo Sorribas <eduardo@sorribas.org> (http://sorribas.org/)", | ||
"devDependencies": { | ||
"brtapsauce": "^0.4.0", | ||
"tape": "^2.13.3" | ||
@@ -22,19 +24,3 @@ }, | ||
"once": "^1.3.0" | ||
}, | ||
"testling": { | ||
"files": "test/index.js", | ||
"browsers": [ | ||
"ie/8..latest", | ||
"firefox/17..latest", | ||
"firefox/nightly", | ||
"chrome/22..latest", | ||
"chrome/canary", | ||
"opera/12..latest", | ||
"opera/next", | ||
"safari/5.1..latest", | ||
"ipad/6.0..latest", | ||
"iphone/6.0..latest", | ||
"android-browser/4.2..latest" | ||
] | ||
} | ||
} |
@@ -5,2 +5,4 @@ # after-all | ||
[![Sauce Test Status](https://saucelabs.com/browser-matrix/after-all.svg)](https://saucelabs.com/u/after-all) | ||
Call several asynchronous functions and invoke a callback 'after all' of them are done. | ||
@@ -20,15 +22,16 @@ | ||
var afterAll = require('after-all'); | ||
var next = afterAll(done); | ||
setTimeout(next(function() { | ||
console.log('Step two.'); | ||
}), 500); | ||
var next = afterAll(function(err) { | ||
if (err) return console.log(err); // one of the asynchronous calls had an error | ||
console.log('Yay! Everything is done'); | ||
}); | ||
setTimeout(next(function() { | ||
console.log('Step one.'); | ||
}), 100); | ||
// The above inner function will only be called when all of these asynchronous calls are done | ||
function done() { | ||
console.log("Yay we're done!"); | ||
} | ||
someAsynchronousCall1({foo:'bar'}, next()); | ||
someAsynchronousCall2({val:2}, next(function(err, res) { | ||
// If you want to do something with the returned value, you can pass a function | ||
if (err) return; | ||
console.log('This was returned: '+res); | ||
})); | ||
``` | ||
@@ -35,0 +38,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10210
9
194
94
2
2506
3