https://github.com/pplgin/multi-download
Nodejs file Download with progress
https://github.com/pplgin/multi-download
Last synced: about 2 months ago
JSON representation
Nodejs file Download with progress
- Host: GitHub
- URL: https://github.com/pplgin/multi-download
- Owner: pplgin
- Created: 2020-01-22T08:53:46.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-22T09:01:35.000Z (over 6 years ago)
- Last Synced: 2025-02-16T09:02:50.060Z (over 1 year ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `multi-donwload`
> Nodejs 多文件下载
## Usage
```
const DownloadManager = require('@pplgin/multi-download');
const downloader = new DownloadManager({
timeout: 4000, // 下载文件超时时长
maxLimit: 20 // 同时下载文件数
})
const fileUrls = [
{
filename: '',
fileUrl: '',
decompression: true,
decompDest: './test/t',
downloadPath: './test'
}
];
downloader.start(fileUrls, data => {
console.log('progress', data.progress);
})
.then(res => { console.log('success!', res); })
.catch(err => {
console.log('error!', err);
});
```