node-dl

Download file from a given sourceUrl to a targetPath with wget

MIT License

Downloads
5
Stars
0
Committers
1

node-dl

Download file from a given sourceUrl to a targetPath with wget.

Usage

const download = require('@mborne/dl');

/*
 * Note that a temp file `{targetPath}.part` is created while downloading to handle download interuptions
 */
const targetPath = await download({
    sourceUrl: 'https://github.com/mborne.keys',
    targetPath: '/tmp/mborne.keys'
});

Options

Name Required? Description Default
sourceUrl YES Source URL (http, https, ftp) NA
targetPath YES Input encoding (UTF-8, LATIN1,...) NA
downloadIfExists NO Download file if targetPath exists? true
unsafeSsl NO Disable certificate checking false

License

MIT