Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
promised-timer
Advanced tools
Promisified Javascript Timer
import Timer from 'promised-timer';
let aTimer = Timer.Seconds(5);
startButton.onClick(() => {
aTimer.start()
.then(() => doSomething())
.catch((e) => log('Exception in doSomething', e))
});
cancelButton.onClick(() => aTimer.cancel());
rightNowButton.onClick(() => aTimer.trigger());
A timer can be started multiple times, canceled, paused and rewound. Paused timer can be resumed to continue up to initial time.
Static Timer.delay
method serves well for simpler cases.
Attach multiple promises to timeline
import { Stopwatch } from 'promised-timer';
const w = new Stopwatch();
w.at(300).then(elapsed => {
elapsed == 300
});
w.at(1000).then(elapsed => {
elapsed == 1000
});
w.start().then(() => "stopwatch stopped", () => "stopwatch cancelled");
Timer.delay(3000, w.stop());
The stopwatch can be paused and resumed.
By default Timer assumes native Promise or polyfill but any Promise implementation can be used by setting Timer.Promise
property.
Typescipt 2.0+
FAQs
Promisified Javascript Timer
The npm package promised-timer receives a total of 5 weekly downloads. As such, promised-timer popularity was classified as not popular.
We found that promised-timer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.