Installations
npm install async-task-mgr
Developer Guide
Typescript
No
Module System
CommonJS
NPM Version
1.4.28
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
ottomao
Download Statistics
Total Downloads
2,481,368
Last Day
214
Last Week
1,164
Last Month
6,423
Last Year
87,946
GitHub Statistics
9 Commits
2 Watching
1 Branches
1 Contributors
Bundle Size
556.00 B
Minified
303.00 B
Minified + Gzipped
Package Meta Information
Latest Version
1.1.0
Package Id
async-task-mgr@1.1.0
Size
1.63 kB
NPM Version
1.4.28
Publised On
28 Nov 2014
Total Downloads
Cumulative downloads
Total Downloads
2,481,368
Last day
-45.8%
214
Compared to previous day
Last week
-37.1%
1,164
Compared to previous week
Last month
13.8%
6,423
Compared to previous month
Last year
-85.9%
87,946
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
No dependencies detected.
async-task-mgr
Intro
A simple nodeJS module for async task manager. Identical tasks will be executed only once and the result will be saved for further use.
Features
- tasks with the same name are identified as the same, and will be executed only once
- task result will be saved for further use
How to use
npm install async-task-mgr --save
Sample
1var asyncTask = require("async-task-mgr"); 2 3var asyncTaskInstance = new asyncTask(); 4 5function taskAction(callback){ 6 setTimeout(function(){ //simulate an async task 7 var resultA = Math.floor(Math.random()*100), 8 resultB = Math.floor(Math.random()*100), 9 resultC = Math.floor(Math.random()*100); 10 11 callback(resultA, resultB, resultC); 12 },2000); 13} 14 15//add a new task named task_A 16//when taskAction is done, its return value will be saved and apply to all the task with the same name 17asyncTaskInstance.addTask("task_A",taskAction,function(resultA,resultB,resultC){ 18 console.log("task A_1 result :" + resultA + " " + resultB + " " + resultC); //all result generated by taskAction will be passed here 19}); 20 21 22//add a new task named task_A 23/* 24since a task with the same name has been added, this taskAction will not be executed. 25the callback function will be put in a queue and will be called when previous callbacks are done. 26*/ 27asyncTaskInstance.addTask("task_A",taskAction,function(resultA,resultB,resultC){ 28 console.log("task A_2 result :" + resultA + " " + resultB + " " + resultC); 29}); 30 31 32//add a new task named task_X 33//a new task, have no relationship to the previous ones 34asyncTaskInstance.addTask("task_X",taskAction,function(resultA,resultB,resultC){ 35 console.log("task X_0 result :" + resultA + " " + resultB + " " + resultC); 36}); 37
Author
Otto Mao ottomao@gmail.com
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/9 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
2.6
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More