
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
worker-timers
Advanced tools
A replacement for setInterval() and setTimeout() which works in unfocused windows
A replacement for setInterval() and setTimeout() which works in unfocused windows.
For scripts that rely on WindowTimers like setInterval() or setTimeout() things get confusing when the site which the script is running on loses focus. Chrome, Firefox and maybe others throttle the frequency of firing those timers to a maximum of once per second in such a situation. However this is only true for the main thread and does not affect the behavior of Web Workers. Therefore it is possible to avoid the throttling by using a worker to do the actual scheduling. This is exactly what WorkerTimers do.
WorkerTimers are available as a package on npm. Simply run the following command to install it:
npm install worker-timers
You can then require the workerTimers instance from within your code like this:
import * as workerTimers from 'worker-timers';
The usage is exactly the same as with the corresponding functions on the global scope.
var intervalId = workerTimers.setInterval(() => {
// do something many times
}, 100);
workerTimers.clearInterval(intervalId);
var timeoutId = workerTimers.setTimeout(() => {
// do something once
}, 100);
workerTimers.clearTimeout(timeoutId);
The worker-timer package provides similar functionality by running timer functions in Web Workers. It aims to provide more accurate timing and less interference from the main thread, similar to worker-timers.
FAQs
A replacement for setInterval() and setTimeout() which works in unfocused windows.
The npm package worker-timers receives a total of 299,600 weekly downloads. As such, worker-timers popularity was classified as popular.
We found that worker-timers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.