# node-wget

> Ultra simple async retrieval of remote files over http or https

Latest version **0.4.3** (published 2018-10-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-wget
pnpm add node-wget
yarn add node-wget
bun add node-wget
```

Provides the command `wget`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.3 |
| Published | 2018-10-04 |
| First published | 2015-11-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.6 |
| Dependencies | 1 |
| Unpacked size | 47.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 13 |
| Author | tylerl0706 |
| Maintainers | tylerl0706 |
| Keywords | curl, wget, download, file, http, https |

## Links

- npm: https://www.npmjs.com/package/node-wget
- Repository: https://github.com/tylerl0706/wgetjs
- Homepage: https://github.com/tylerl0706/wgetjs#readme
- Issues: https://github.com/tylerl0706/wgetjs/issues
- npm.io page: https://npm.io/package/node-wget

## Dependencies (1)

- [request](https://npm.io/package/request.md) ~2.85.0

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.4.3 (latest) — 2018-10-04
- 0.4.2 — 2015-12-13
- 0.4.1 — 2015-11-27
- 0.4.0 — 2015-11-27

## README

# wgetjs [![NPM version](https://badge.fury.io/js/wgetjs.png?branch=master)](http://badge.fury.io/js/wgetjs) [![Build Status](https://travis-ci.org/angleman/wgetjs.png?branch=master)](https://travis-ci.org/angleman/wgetjs) [![Dependency Status](https://gemnasium.com/angleman/wgetjs.png?branch=master)](https://gemnasium.com/angleman/wgetjs) [![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](#licensemit)
Ultra simple async retrieval of remote files over http or https inspired by wgetjs

## Install

```
npm install node-wget
```

## Usage

```javascript
var wget = require('node-wget');

wget(url);

wget(url, callback);

wget({url: url, dest: destination_folder_or_filename}, callback);

wget({url: url, dry: true}); // dry run, nothing loaded, callback passing parsed options as data
```

## Examples

```javascript
var wget = require('node-wget');

wget('https://raw.github.com/angleman/wgetjs/master/angleman.png');   // angleman.png saved to current folder

wget({
        url:  'https://raw.github.com/angleman/wgetjs/master/package.json',
        dest: '/tmp/',      // destination path or path with filenname, default is ./
        timeout: 2000       // duration to wait for request fulfillment in milliseconds, default is 2 seconds
    },
    function (error, response, body) {
        if (error) {
            console.log('--- error:');
            console.log(error);            // error encountered
        } else {
            console.log('--- headers:');
            console.log(response.headers); // response headers
            console.log('--- body:');
            console.log(body);             // content of package
        }
    }
);

// dry run
wget({
    url: 'https://raw.github.com/angleman/wgetjs/master/package.json',
    dest: '/tmp/',
    dry: true
    }, function(err, data) {        // data: { headers:{...}, filepath:'...' }
        console.log('--- dry run data:');
        console.log(data); // '/tmp/package.json'
    }
);
```

## CLI

Install:

```bash
$ npm install -g node-wget
```

Use:

```text
Usage: wget [options] <url>

Ultra simple async retrieval of remote files over http or https

Options:

  -h, --help                        output usage information
  -v, --version                     output version number
  -d, --destination <folder>        specify download destination

Usage:

# Download file
$ wget https://github.com/NodeOS/NodeOS/archive/master.zip

# Download file to location
$ wget https://github.com/NodeOS/NodeOS/archive/master.zip -d path/to/here/
```

## License: MIT

---
_Source: https://npm.io/package/node-wget · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
