
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
set-timeout-by-id
Advanced tools
A simple package to set and clear a timeout by id instead of using variables.
This is a timeout implementation that allows you to set a timeout and then clear it using keys instead of the timeout variable reference.
This is useful when you have to clear a timeout from a different scope than the one where it was set.
npm install set-timeout-by-id
import { setTimeoutById, clearTimeoutById } from 'set-timeout-by-id';
const timeoutId = setTimeoutById(() => {
console.log('Hello World!');
}, 1000, 'myTimeout'); // This will set a timeout with the id 'myTimeout'
// Meanwhile, in another file...
clearTimeoutById('myTimeout'); // This will clear the timeout
This library uses a Map to store the timeout references, leveraging the singleton
pattern.
When you set a timeout, it will be stored in the Map with the given id as key.
When you clear a timeout, it will be removed from the Map and cleared using the reference stored in the Map.
npm test
If you want to contribute to this project, please open an issue or a pull request.
I will be happy to review it and merge it if it's useful.
Please, remember to follow the Conventional Commits standard.
FAQs
A simple package to set and clear a timeout by id instead of using variables.
The npm package set-timeout-by-id receives a total of 0 weekly downloads. As such, set-timeout-by-id popularity was classified as not popular.
We found that set-timeout-by-id 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
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.