weachy
A tiny (17 lines of code) async waterfall implementation that supports CommonJS, AMD, and VanillaJS. The minified file weachy.min.js
is just 355 bytes.
Install
npm
npm install weachy
bower
bower install weachy
Usage
waterfall(array, callback, context)
Arguments
array
- An array of functions that take acallback(err, result1, result2, ...)
as the last argument. The arguments preceeding the callback are the results of the previous function in the array.callback(err, result1, result2, ..., resultn)
- The callback that is called when all functions in thearray
are finished or an error occurs.context
(optional) - The context to be used when calling each function in thearray
.
Examples
Browser (No module loader)
Node.js
var waterfall = ;var jsdom = ;var fs = ; var url = processargv2; ;