How can I get an integer from setTimeout in Nodejs?
I really wasn't believing that in nodejs(which I'm so in love)you would be forced to make such functions.
Fortunately there is an undocumented method on setTimeout's return(setInterval also has it!) called close
var timer = setInterval(doSomething, 1000);
setTimeout(function() {
// delete my interval
timer.close()
}, 5000);
Hope it be useful