Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

after-all

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

after-all - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

test/sauce.js

22

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc