varSerial=require('simple-flow-control').serial;varserial=newSerial();// orvarserial=Serial();varf1=function(result,next){setTimeout(function(){console.log('Function 1 executed!',result);next(null,'Value send by function 1');},2000);};varf2=function(result,next){setTimeout(function(){console.log('Function 2 executed!',result);// next(new Error('Bugou tudo'), 'Value send by function 2');next(null,'Value send by function 2');},3000);};varf3=function(result,next){setTimeout(function(){console.log('Function 3 executed!',result);next(null,'Value send by function 3');},3000);};serial.registerTask(f1);serial.registerTask(f2);serial.registerTask(f3);serial.start('Initial value');