
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
An Event Emitter based timer with return arguments
npm install wait-a-bit -save
var waitABit = require('wait-a-bit');
var timer = new waitABit();
timer.set(2000); //milliseconds
timer.on('expire',function(returnArguments){
console.log('Ended', returnArguments);
//anything passed into timer.start() will be called back here;
});
var sendObject = {hello: 'world',this: 'is-me'}
timer.start(sendObject);
//if you want to stop a timer once started use the timer.clear() method.
var timer = new waitABit();
Takes milliseconds as an argument, does not initiate the timer;
timer.set(milliseconds);
Takes any number of arguments and passes it back via the 'expired' event after the milliseconds of SET has expired.
timer.start([object],[string],[int],[array]);
Resets the timer and does not emit the 'expired' event
timer.clear();
You can listen for the start event if you need to know exactly when the timer started counting down;
timer.on('start',function(){
console.log('timer started')
});
You can listen for the clear event if you need to execute code after a timer has been cleared.
timer.on('clear',function(){
console.log('timer cleared')
});
You cal listen for the end event if you need to execute code after a timer has expired.
timer.on('expired',function(args){
console.log('timer expired with arguments returned:',args);
});
FAQs
An Event emitter based timer with argument returns
The npm package wait-a-bit receives a total of 2 weekly downloads. As such, wait-a-bit popularity was classified as not popular.
We found that wait-a-bit demonstrated a not healthy version release cadence and project activity because the last version was released 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
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.