queueue-download

2.0.0 • Public • Published

queueue-download

NPM Version NPM Downloads

File download queue with unique file names support

Instalation

npm i queueue-download

Usage

const download = require('queueue-download');
 
const files = [
  {
    remote: 'url://to/remote/file',
    local: '/localpath/to/file'
  },
  {
    remote: 'url://to/remote/file',
    local: '/localpath/to/file'
  }
];
 
const res = await download(files);

Options

async download(files, opts);

Returns an array with results. It never throws an error, all errors are in the result array.

  • force — force path creation
  • concurrency — number of simultaneous downloads, 'auto' or undefined are equals to cpus number

Id

Also you can add an id field to the files, and it will be returned in the result.

Unique file names

You can use pattern in the local file name as described in the fsu module

License: MIT

Package Sidebar

Install

npm i queueue-download

Weekly Downloads

4

Version

2.0.0

License

MIT

Unpacked Size

5.44 kB

Total Files

6

Last publish

Collaborators

  • velocityzen