Skip to content

Instantly share code, notes, and snippets.

@cxreg
Created January 20, 2013 07:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save cxreg/4577093 to your computer and use it in GitHub Desktop.
Save cxreg/4577093 to your computer and use it in GitHub Desktop.
node async
var async = require('async');
function one(cb) {
console.log("one");
cb();
}
function two(cb) {
function three(callback){
var a = [];
for (var i = 1; i <= 3; i++) {
a.push(i);
};
callback(null, a);
}
function four(work, callback) {
console.log(work);
callback(null);
}
async.waterfall([three, four], cb);
}
function three(cb) {
console.log('even more');
cb();
}
async.series([one, two, three]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment