How to use 'async waterfall example' in JavaScript

Every line of 'async waterfall example' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
45function _waterfall (steps, done) {
46 function next () {
47 var d = once(done);
48 return once(function callback () {
49 var args = atoa(arguments);
50 var step = steps.shift();
51 if (step) {
52 if (handle(args, d)) { return; }
53 args.push(next());
54 cb(step, args);
55 } else {
56 cb(d, arguments);
57 }
58 });
59 }
60 next()();
61}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code


Related snippets