Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ajhsu/node-wget-promise
Using wget in Node, with Promise support.
https://github.com/ajhsu/node-wget-promise
nodejs promise wget
Last synced: 3 months ago
JSON representation
Using wget in Node, with Promise support.
- Host: GitHub
- URL: https://github.com/ajhsu/node-wget-promise
- Owner: ajhsu
- License: mit
- Created: 2018-02-09T04:02:46.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-17T05:07:27.000Z (almost 6 years ago)
- Last Synced: 2024-10-14T03:49:27.310Z (3 months ago)
- Topics: nodejs, promise, wget
- Language: JavaScript
- Homepage:
- Size: 95.7 KB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-wget-promise
`node-wget-promise` simplifies retrieving files from any URL, with Promise support.
[![npm](https://img.shields.io/npm/v/node-wget-promise.svg)](https://www.npmjs.com/package/node-wget-promise)
[![Build Status](https://travis-ci.org/ajhsu/node-wget-promise.svg?branch=master)](https://travis-ci.org/ajhsu/node-wget-promise)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)> This package is forked and enhanced from [wget-improved](https://github.com/bearjaws/node-wget)
## Installation
```
npm install node-wget-promise --save
```## Usage
### The simpliest example
```js
const wget = require('node-wget-promise');wget('http://nodejs.org/images/logo.svg');
```### The basic example with callbacks
```js
const wget = require('node-wget-promise');wget([url], {
onStart: [Callback],
onProgress: [Callback],
output: [outputFilePath]
})
.then(metadata => [fileMetadata])
.catch(err => [Error]);
```### Work with async-await syntax
```js
const wget = require('node-wget-promise');(async () => {
await wget([url]);
console.log('Done');
})();
```