Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
async-task-mgr
Advanced tools
A simple nodeJS module for async task manager. Identical tasks will be executed only once and the result will be saved for further use.
A simple nodeJS module for async task manager. Identical tasks will be executed only once and the result will be saved for further use.
npm install async-task-mgr --save
var asyncTask = require("async-task-mgr");
var asyncTaskInstance = new asyncTask();
function taskAction(callback){
setTimeout(function(){ //simulate an async task
var resultA = Math.floor(Math.random()*100),
resultB = Math.floor(Math.random()*100),
resultC = Math.floor(Math.random()*100);
callback(resultA, resultB, resultC);
},2000);
}
//add a new task named task_A
//when taskAction is done, its return value will be saved and apply to all the task with the same name
asyncTaskInstance.addTask("task_A",taskAction,function(resultA,resultB,resultC){
console.log("task A_1 result :" + resultA + " " + resultB + " " + resultC); //all result generated by taskAction will be passed here
});
//add a new task named task_A
/*
since a task with the same name has been added, this taskAction will not be executed.
the callback function will be put in a queue and will be called when previous callbacks are done.
*/
asyncTaskInstance.addTask("task_A",taskAction,function(resultA,resultB,resultC){
console.log("task A_2 result :" + resultA + " " + resultB + " " + resultC);
});
//add a new task named task_X
//a new task, have no relationship to the previous ones
asyncTaskInstance.addTask("task_X",taskAction,function(resultA,resultB,resultC){
console.log("task X_0 result :" + resultA + " " + resultB + " " + resultC);
});
Otto Mao ottomao@gmail.com
FAQs
A simple nodeJS module for async task manager. Identical tasks will be executed only once and the result will be saved for further use.
We found that async-task-mgr 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 threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.