🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

download

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

download - npm Package Compare versions

Comparing version

to
0.1.1

4

package.json
{
"name": "download",
"version": "0.1.0",
"description": "Download and extract files",
"version": "0.1.1",
"description": "Download and extract files effortlessly",
"keywords": [

@@ -6,0 +6,0 @@ "url",

# download [![Build Status](https://secure.travis-ci.org/kevva/download.png?branch=master)](http://travis-ci.org/kevva/download)
Downloading made easy.
Download and extract files effortlessly in Node.js.

@@ -11,14 +11,29 @@ ## Getting started

If you're fetching an archive you can set `extract: true` in options and
it'll extract it for you.
```js
var download = require('download');
download('foo.tar.gz', 'bar');
// => download and extract `foo.tar.gz` into `bar/`
// download and extract `foo.tar.gz` into `bar/`
download('foo.tar.gz', 'bar', { extract: true; });
// download and save `foo.jpg` into `bar/foo.jpg`
download('foo.jpg', 'bar/foo.jpg');
// => download and save `foo.jpg` into `bar/foo.jpg`
```
## API
### download(url, dest, opts)
Download a file to a given destination.
## Options
* `extract` — If set to `true`, try extracting the file using [decompress](https://github.com/kevva/decompress/).
You can also define options accepted by the [request](https://github.com/mikeal/request/) module.
## License
[MIT License](http://en.wikipedia.org/wiki/MIT_License) (c) [Kevin Mårtensson](http://kevinmartensson.com)