Skip to content
/ node-dl Public

Download file from a given sourceUrl to a targetPath with wget

License

Notifications You must be signed in to change notification settings

mborne/node-dl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-dl

Node.js CI Coverage Status

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