Queue and drain an array of functions in series
Queue and drain an array of functions in series.
npm install drainer --save
var drainer = ;;
Each function in the array recieves a callback,
next(), to call when done. If only one argument is passed into that callback, it will assume that it is an error, exit the chain, and call the final callback with the error.
If you have arguments that you want to pass to each method without explicitly passing them each method, you can easily do that like this:
var drainer = ;var drain =;;
If you call the
next() callback in the queued function with the first argument as
null, any argument following will be passed to the next function in the queue.
The final callback will recieve any values passed from the last function in the function queue.
npm installnpm test