Skip to content

Instantly share code, notes, and snippets.

@dineshsprabu
Created January 19, 2016 05:44
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save dineshsprabu/e6c1cf8f2ca100a8f5ae to your computer and use it in GitHub Desktop.
Save dineshsprabu/e6c1cf8f2ca100a8f5ae to your computer and use it in GitHub Desktop.
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
Copy link

paulg78 commented May 10, 2017

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

@marffinn
Copy link

Helped me too. Good work

@poximan
Copy link

poximan commented Sep 7, 2017

capo!, clarisimo

@baur
Copy link

baur commented Jan 1, 2021

Helped me, Thank you!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment