time-utils
setTimeout
is not coffeescript friendly, so here is the replacement
install using npm
npm install time-utils
usage
require 'time-utils' delay 1000-> consolelog '1 second passed'
bonuses
readable time
delay '5s'-> consolelog '5 seconds passed'
run every 2.5 hours
delay '2.5h' consolelog '2.5 hours passed' unless somethingwrong repeat
unix timestamp
require 'time-utils'consolelog "timestamp now: "
supported format
s|second|seconds h|hour|hours d|day|days
2days and 12hours
is not supported, use 2.5days
instead