Downloadr
Binary file download library built on top of got.
Installation
npm install downloadr
Features
- Progression tracking
- File integrity check
- Abort
- Queue
Usage
Initialization
const Downloadr = ; const downloadr = ;
Queue a download
downloadr;
You can also pass an array of downloads directly to the constructor:
const downloadr = url: 'http://localhost/file.zip' hash: '4fb8652b2be29734df530fc0cfcaae922564b840' file: 'file.zip' ;
Event listeners
// Progressdownloadr; // Job enddownloadr; // Enddownloadr;
Post processing
Use postProcess
argument to pass a function that will be executed after a successful download, but before jobEnd
event is triggered:
downloadr;
If postProcess
returns a promise, jobEnd
will only be triggered once it's fulfilled (and pass an error if it's rejected).
downloadr;
Start/abort download queue
// Start queuedownloadrstart; // Abort queuedownloadr;
Tests
To run the test suite, first install the dependencies, then run npm test
:
npm installnpm test
Resources
TODO
- Seen an issue with 0b files