graceful-timer
Graceful timer for catch errors. I make this module bacause i come across some problems when i try to run some isomophic code on the nodejs server. Some code maybe makes sense in the browser, but dangrous in server environment, for example:
try xxx catch e // for some purposes, we do asychronous error thrown ;
API
Just use as the same as the original global timers api. The only
thing this module does is wrap the callback
with try catch
.
-
setTimeout
-
setInterval
-
setImmediate
-
setLogger It will use
global.console
as default logger. However, you can customize your own logger only if the.error
method is provided.
const setLogger = ; ;
Lisence
MIT