
Research
/Security News
11 Malicious Go Packages Distribute Obfuscated Remote Payloads
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
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
$ npm i -D @types/redis
example:
import { distributedDebounce } from 'node-distributed-debounce';
// const { distributedDebounce } = require('node-distributed-debounce');
import redis from 'redis';
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));
}
const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
function main() {
for (let i = 0; i < 10; i++) {
debouncedCall(i);
await 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 552 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
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
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).