Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
NodeJS Async WaterFall Example
var async = require('async');
async.waterfall(
[
function(callback) {
callback(null, 'Yes', 'it');
},
function(arg1, arg2, callback) {
var caption = arg1 +' and '+ arg2;
callback(null, caption);
},
function(caption, callback) {
caption += ' works!';
callback(null, caption);
}
],
function (err, caption) {
console.log(caption);
// Node.js and JavaScript Rock!
}
);
@paulg78

This comment has been minimized.

Copy link

commented May 10, 2017

Thanks, I was looking for a simple, clear example and this is just what I needed!

@marffinn

This comment has been minimized.

Copy link

commented Jul 28, 2017

Helped me too. Good work

@poximan

This comment has been minimized.

Copy link

commented Sep 7, 2017

capo!, clarisimo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.