Gathering detailed insights and metrics for node-multi-resume-retry-timeout-download
Gathering detailed insights and metrics for node-multi-resume-retry-timeout-download
npm install node-multi-resume-retry-timeout-download
Typescript
Module System
Node Version
NPM Version
74.5
Supply Chain
96.9
Quality
74.2
Maintenance
100
Vulnerability
99.3
License
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
1,003
Last Day
1
Last Week
3
Last Month
12
Last Year
110
Latest Version
0.0.1
Package Id
node-multi-resume-retry-timeout-download@0.0.1
Size
369.73 kB
NPM Version
5.5.1
Node Version
8.9.1
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
200%
3
Compared to previous week
Last Month
-7.7%
12
Compared to previous month
Last Year
-26.2%
110
Compared to previous year
4
50
a new method download http data in multiple, resume, retry.
download-task-list
[{downloadTask},{downloadTask},{downloadTask}]
shell
1 2npm i --save node-multi-resume-retry-timeout-download 3npm i -d 4
js
1const DownloadTask = require('node-mutil-downloader').DownloadTask; 2const DownloadTaskList = require('node-mutil-downloader').DownloadTaskList; 3
OR SEE test
1 2 3 4const downloadTaskList = new DownloadTaskList(); 5downloadTask = new DownloadTask({ 6 downloadUrl, 7 savePath 8}); 9downloadTaskList.register(downloadTask); 10downloadTaskList.startDownloadTask(downloadTask, index, progressCatch(dispatch, getState), downloadResultHandler(dispatch, getState)); 11 12
1 2reducers 3 4function downloadTaskList(state = { 5 list: new DownloadTaskList(), 6 trigger: 'init' 7}, action = {}) { 8 switch (action.type) { 9 case types.UPDATE_LIST: 10 return { 11 list: action.list, 12 time: action.time 13 }; 14 case types.CLEAR_LIST: 15 return { 16 list: action.list, 17 time: action.time 18 }; 19 case types.REMOVE_DOWNLOAD: 20 return { 21 list: action.list, 22 time: action.time 23 }; 24 case types.DOWNLOAD_PROGRESS: 25 return { 26 trigger: action.trigger,// progress || finish 27 list: action.list, 28 time: action.time 29 }; 30 default: 31 return state 32 } 33} 34 35 36handlers: 37 38function progressCatch(dispatch) { 39 const getState = [].slice.call(arguments, 1)[0]; 40 return function () { 41 const downloadTaskList = getState().downloadTaskList.list; 42 return dispatch(downloadProgressUpdate(downloadTaskList, "progress")); 43 } 44} 45 46 47function processMapFileAction(file,directory) { 48 return async (dispatch, getState) => { 49 const mapInfo = await mapUtils.analysisMapTarGz(file,directory); 50 mapInfo.time = new Date().valueOf(); 51 await mapUtils.saveMapMetaToDB(mapInfo); 52 return dispatch(choseMap(mapInfo)); 53 } 54} 55 56 57caller: 58 59 const downloadTaskList = getState().downloadTaskList.list; 60 const downloadTask = new DownloadTask({ 61 type, 62 downloadUrl, 63 savePath, 64 saveName 65 }); 66 downloadTaskList.register(downloadTask); 67 downloadTask.start(progressCatch(dispatch, getState), downloadResultHandler(dispatch, getState)); 68 69 70
No vulnerabilities found.
No security vulnerabilities found.