1.0.1 • Published 8 years ago
downloadbooster v1.0.1
downloadbooster
Installation
npm install -g downloadboosterCLI Usage
Command line options for the fetch command are:
Options
-o, --output-file <outputFile> Name to save the output file
-c, --chunk-size <chunkSize> Size of chunks in bytes
-m, --max-chunks <maxChunks> Max number of chunks to download
-h, --help output usage informationDefaults
--output-file output.pdf
--chunk-size 1048576 // 1024 * 1024 = 1 MiB
--max-chunks 0 // 0 - ignored if zero
CommonJS Usage
const downloadBooster = require('downloadbooster');
const options = {
chunkSize: 1024 * 1024,
maxChunks: 20,
outputFilename: 'output.pdf'
};
downloadBooster('https://www.hrw.org/sites/default/files/reports/wr2010_0.pdf');CLI Examples
Using default options
downloadbooster fetch https://www.hrw.org/sites/default/files/reports/wr2010_0.pdfSpecifying an output file
downloadbooster fetch -o another-file.pdf https://www.hrw.org/sites/default/files/reports/wr2010_0.pdfSpecifying a chunk size of 1 Kib
downloadbooster fetch -c 1024 -o image.png https://wiesmann.codiferes.net/share/bitmaps/test_pattern.pngSpecifying a max chunk of 1
downloadbooster fetch -m 1 https://www.hrw.org/sites/default/files/reports/wr2010_0.pdfDownload first KiB only
downloadbooster fetch -m 1 -c 1024 https://www.hrw.org/sites/default/files/reports/wr2010_0.pdfSave first KiB to specific output file
downloadbooster fetch -m 1 -c 1024 -o my-tiny-file.pdf https://www.hrw.org/sites/default/files/reports/wr2010_0.pdf