flow
Simple & basic flow control with no dependencies. Its simple, fast. No BS. Its an extension of fastsync
https://github.com/joekarl/fastsync.
Use it in browsify
, webpack
, node.js/io.js
Covers 4 basic use cases:
- parallel - Run functions in parallel and callback when finished
- series - Run functions in series and callback when finished
- waterfall - Run functions in series while passing results of one function to the next
- asyncMap - Convenience method for mapping an array using asynchronous functions, analogous to an async version of Array.forEach with all tasks kicked off in parallel
- seriesMap - Convenience method for mapping an array using asynchronous functions, analogous to an async version of Array.forEach with all tasks kicked off in series
Note about function resolution
All functions are resolved immediately, to delay/overhead of next tick of the event loop. If you need to evaluate on next tick, use either setImmediate or process.nextTick. Add a wrapper, probably on your functions.
Usage
$ npm install kevbookflow --savevar flow = ;
Examples
parallel
flow;
series
flow;
waterfall
flow;
parallelMap
Note Results can be processed in any order but will be returned in the order submitted
flow;
seriesMap
flow;