Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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 coordination. For testing, you can use redis-mock or any other library that conforms to the node_redis interface.
TODO
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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.