Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-11T05:05:54.000Z (7 months ago)
- Last Synced: 2024-10-08T15:11:57.258Z (3 months 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
[![Node.js CI](https://github.com/mborne/node-dl/actions/workflows/node.js.yml/badge.svg)](https://github.com/mborne/node-dl/actions/workflows/node.js.yml) [![Coverage Status](https://coveralls.io/repos/github/mborne/node-dl/badge.svg?branch=master&kill_cache=1)](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)