An open API service indexing awesome lists of open source software.

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

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);
});
```