
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
setinterval-bykey
Advanced tools
npm install setinterval-bykey
const intervalManager = require('interval-manager');
// Start an interval that logs "Hello" every second
intervalManager.start(() => {
console.log('Hello');
}, 1000, 'greeting');
// Check if 'greeting' interval is running
console.log(intervalManager.isRunning('greeting')); // true
// Stop the 'greeting' interval after 5 seconds
setTimeout(() => {
intervalManager.clear('greeting');
console.log('Greeting interval stopped');
}, 5000);
start(fn, interval, key)Starts a new interval with the callback function fn running every interval milliseconds under the identifier key.
Throws TypeError if parameters are invalid.
Returns true if interval started successfully, or false if an interval with the same key already exists.
isRunning(key)Checks if an interval under the given key is currently active.
Throws TypeError if key is invalid.
Returns true if running, otherwise false.
clear(key)Stops and removes the interval identified by key.
Throws TypeError if key is invalid.
Returns true if interval was cleared, or false if no interval found under that key.
clearAll()Stops and clears all running intervals.
MIT
Youssef Mohamed - (SLASH)
Feel free to open issues or contribute! 🚧
FAQs
A simple Node.js utility to manage multiple named intervals easily.
The npm package setinterval-bykey receives a total of 5 weekly downloads. As such, setinterval-bykey popularity was classified as not popular.
We found that setinterval-bykey 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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.