
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).
node-distributed-debounce
Advanced tools
debounce function for distributed system with redis and nodejs.
debounce function for distributed system with redis and nodejs.
$ npm i -S node-distributed-debounce
and install redis
$ npm i -S redis
example:
import { distributedDebounce } from 'node-distributed-debounce';
// const { distributedDebounce } = require('node-distributed-debounce');
import redis from 'redis';
const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
const redisclient = redis.createClient();
function debouncedCall(index: number) {
distributedDebounce(() => {
console.log('called', index);
}, {
wait: 5, // sec
key: 'dist:debounce:call', // key for debounce
redisclient,
}).catch(e => console.error(e));
}
function main() {
for (let i = 0; i < 10; i++) {
debouncedCall(i);
wait(100);
}
}
output:
called 9
FUNCTION DISTRIBUTED_DEBOUCE(key, wait, callback)
currentCounter = MULTI
INCR(key)
EXPRE(key, wait)
EXEC
SLEEP(wait)
counter = GET(key)
IF currentCounter != counter
EXIT
END
IF SET(key_lock, '', NX, PX, 100) != OK
EXIT
END
callback()
FAQs
debounce function for distributed system with redis and nodejs.
The npm package node-distributed-debounce receives a total of 535 weekly downloads. As such, node-distributed-debounce popularity was classified as not popular.
We found that node-distributed-debounce 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.