timer-shim

JSON →
library 0.3.0 ·javascript abandoned
verified May 27, 2026

Timer-shim is a lightweight wrapper around setTimeout, setInterval, and clearTimeout/clearInterval that facilitates testing time-dependent code without modifying global state. It provides multiple aliases (e.g., timer.timeout, timer.to, timer.t) for convenience and validates arguments against NaN and non-function values. Version 0.3.0 is stable but appears unmaintained (last release 2012). Unlike sinon's fake timers, timer-shim only stubs calls without advancing time. Its key differentiator is simplicity and avoidance of global overrides, making it suitable for isolated unit tests.

total hits 16
actors 5 distinct systems
last hit 1d ago AhrefsBot
GPTBot
5
MetaBot
4
Script
1
Humans
2

top countries 🇺🇸 United States · 🇨🇦 Canada · BD · 🇩🇪 Germany · 🇫🇷 France