A lightweight download accelerator. Similar to axel.axel-js tries to accelerate the downloading process by using multiple connections for one file and supports HTTP and HTTPS protocols.
npm install axel-js
var axel = require('axel-js');
axel.download('http://nginx.org/download/nginx-1.11.5.tar.gz', {
output: './nginx.tar.gz',
quiet: false,
verbose: false,
numConnections: 3,
header: []
}).then((data) => {
//download finished
console.log(data);
// => {
// url: '<string>',
// size: <number>,
// startTime: '<Date>',
// endTime: '<Date>'
//}
}).catch((error) => {
//an error occurred
});
- url string of the file URL to download
- options object with options
- numConnections
- verbose
- quiet
- output
returns a promise object
returns an object containing error code
Usage:axel-js [options] url
Available Options:
-n, --num-connections <NUM-CONNECTION>
Specify maximum number of connections
-o, --output <OUTPUT>
Specify local output file
-H, --header <HEADER>
Add header string
-v, --verbose More status information
-q, --quiet No output to stdout
-h, --help Display this help message