Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
query-swarm
Advanced tools
Safely distribute query-driven tasks over a swarm of parallel functions on a single process or across multiple processes/machines.
Query Swarm allows you to safely distribute query-driven tasks over a swarm of parallel functions on a single process or across multiple processes/machines.
var redis = require('redis').createClient();
var QuerySwarm = require('../lib/QuerySwarm.js')(redis);
function query(cursor, callback) {
// you can get a starting cursor from another data source if you wish
cursor = cursor || 0;
// perform the query (you would probably connect to a database here...)
var results = [], newCursor = cursor;
while (newCursor < cursor + 100) {
results.push(newCursor);
newCursor++;
}
// return any error, the new cursor, and results
callback(null, newCursor, results);
}
function worker(task, callback) {
// do something with the task
var result = task * 2;
// return any error, and the result
callback(null, result);
}
var swarm = new QuerySwarm('myFirstSwarm', query, worker);
swarm.start();
swarm.stop(function(){
// this node has gracefully stopped
});
####Use when the following are important:
####Do not use if the following are required:
Query Swarm relies on redis to store the lock, cursor, queue, and lists responsible for swarm coordination.
See tl;dr above.
FAQs
Safely distribute query-driven tasks over a swarm of parallel functions on a single process or across multiple processes/machines.
The npm package query-swarm receives a total of 13 weekly downloads. As such, query-swarm popularity was classified as not popular.
We found that query-swarm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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 researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.