consec
Wrap a bunch of async operations into one function and iterate each step consecutively
seamlessly returning
a promise resolving with the end returned value. If an error is throw along the way or a yield promise
fails then the promise rejects allowing you to catch the error.
Installation
$ npm install consec
Usage
var consec = // you can also yield regular values // you can pass in the function context and parametersvar ctx = {} { this // => ctx return 'a' 'b' 'c'} consec // if an error is throwm then the chain ends therevar error = // if a promise is rejected then the chain ends therevar error = // a generator can also be yielded { return Promise} // finally you can even nest consec calls inside one another { return Promise} return