A simple script to run asynchronous tasks sequentially. Alternative to async.waterfall
npm i -S gist:81cb708f0ef01ed2d3ecf6e6aae43013
import waterfallTasks from '0tis-waterfall';
waterfallTasks([
cb=>{
const error = null;
const data1 = 'good';
const data2 = 'day';
cb(error, data1, data2);//the first parameter is always an error, the other parameters will be passed to the next task.
},
(cb, data1, data2)=>{
cb();
}
], (err, data)=>{
//do finally task
});