async-straight
async.series
A light weight module to run asynchronous tasks in series, inspired fromInstallation
npm install async-straight
API
var straight =
straight(tasks, [callback])
It executes each function in tasks
in series and after their execution calls the optional callback
(if supplied).
Arguments
tasks
- An array or object containing functions to run, each function is passed acb(err, result)
it must call on completion with an errorerr
(which can benull
) and an optionalresult
value.callback(err, results)
- An optional callback to run once all the functions have completed. This function gets a results array (or object) containing all the result arguments passed to thetask
callbacks.
Example
; // an example using an object instead of an array;
Tests
npm run test
Author
Tabish Rizvi (sayyidtabish@gmail.com)
License
MIT