Run async functions in serial with an onDone callback.
npm install --save atlas-serial
This is for running async subroutines in serial, regardless of whether or not tasks up the chain return errors. Since this is purely for control flow, tasks' results aren't tracked at all. If your Nth task depends on your N-1th task's outcome, use a waterfall or some other structure.
Usage is pretty simple -- just pass in an array of jobs (which each take a
done callback) and an
allDone callback. The
allDone callback is optional and is called after each of the
done callbacks have been called.
array of jobs
The following will run
reddit.post only after
email.send has finished:
const serial = ;