WARNING! This module should be considered deprecated. If you are seeking this functionality, I recommend utilizing the nearly equivalent
safe-timers module instead.
A Node.js module that wraps
clearInterval to safely operate on delays greater than the max 32-bit integer (
2147483647) but less than
1.79E+308). Of course, you can use these safe versions of the functions for delays that are less than the max 32-bit integer, too.
That said, if you need to run a
setInterval with a delay greater than 24.85 days, you may want to rethink your strategy to begin with. This module was mostly made to prove a point. 😏
Please note that, for use as the "delay" with
treat the numeric values of
0 (though they are also typically executed in the order listed). This module does not handle any of those values, and so the behavior will match the underlying behavior of Node.
- treat numerical values greater than
- treat numerical values less than
npm install safetimeout
var safe = ;var timeoutId = safe;safe;var intervalId = safe;safe;
Note that there are no unit tests because any real test would need to run for about 25 days. I am fairly confident that Travis-CI would auto-kill the build long before then... likely within 1 hour.