flatstack

flatstack.js ============

npm install flatstack
81 downloads in the last day
221 downloads in the last week
1 090 downloads in the last month
var flatstach = require("flatstack");
var queue = flatstack();


queue.push(function() {
  setTimeout(queue.pause().resume, 0);
});

//if argument[0] is present, then it's async
queue.push(function(next) {
   setTimeout(next, 0);
});

//called immediately
queue.push(function() {

  //but look, you can inject functions before the next one is called!
  queue.unshift(function() {
    queue.pause.resume(); //calls async timeout
  });
});
npm loves you