https://github.com/mborne/node-dl
Download file from a given sourceUrl to a targetPath with wget
https://github.com/mborne/node-dl
download ftp http https nodejs wget
Last synced: 3 months ago
JSON representation
Download file from a given sourceUrl to a targetPath with wget
- Host: GitHub
- URL: https://github.com/mborne/node-dl
- Owner: mborne
- License: mit
- Created: 2019-06-02T20:35:54.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-11T05:05:54.000Z (almost 2 years ago)
- Last Synced: 2025-03-06T11:49:26.975Z (about 1 year ago)
- Topics: download, ftp, http, https, nodejs, wget
- Language: JavaScript
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-dl
[](https://github.com/mborne/node-dl/actions/workflows/node.js.yml) [](https://coveralls.io/github/mborne/node-dl?branch=master)
Download file from a given `sourceUrl` to a `targetPath` with `wget`.
## Usage
```js
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](LICENSE)