Socket
Socket
Sign inDemoInstall

download

Package Overview
Dependencies
236
Maintainers
3
Versions
70
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.1-rc.1 to 4.0.1

1

cli.js

@@ -6,3 +6,2 @@ #!/usr/bin/env node

var meow = require('meow');
var progress = require('download-status');
var stdin = require('get-stdin');

@@ -9,0 +8,0 @@

2

package.json
{
"name": "download",
"version": "4.0.1-rc.1",
"version": "4.0.1",
"description": "Download and extract files effortlessly",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -19,3 +19,3 @@ # download [![Build Status](http://img.shields.io/travis/kevva/download.svg?style=flat)](https://travis-ci.org/kevva/download)

var download = new Download({ extract: true, strip: 1, mode: '755' })
var download = new Download({extract: true, strip: 1, mode: '755'})
.get('http://example.com/foo.zip')

@@ -40,52 +40,61 @@ .get('http://example.com/cat.jpg')

### .get(url, [dest])
#### opts.extract
Type: `String`
Type: `Boolean`
Default: `false`
Add a file to download.
If set to `true`, try extracting the file using [decompress](https://github.com/kevva/decompress/).
### .dest(dir)
#### opts.mode
Type: `String`
Type: `String`
Set the destination folder to where your files will be downloaded.
Set mode on the downloaded file, i.e `{mode: '755'}`.
### .rename(name)
#### opts.strip
Type: `Function|String`
Type: `Number`
Default: `0`
Rename your files using [gulp-rename](https://github.com/hparra/gulp-rename).
Equivalent to `--strip-components` for tar.
### .run(cb)
### .get(url, [dest])
Type: `Function`
#### url
Downloads your files and returns an error if something has gone wrong.
Type: `String`
#### cb(err, files)
Add a URL to download.
The callback will return an array of vinyl files.
#### dest
## Options
Type: `String`
### extract
Set an optional destination folder that will take precedence over the one set in
`.dest()`.
Type: `Boolean`
Default: `false`
### .dest(dir)
If set to `true`, try extracting the file using [decompress](https://github.com/kevva/decompress/).
#### dir
### mode
Type: `String`
Type: `String`
Set the destination folder to where your files will be downloaded.
Set mode on the downloaded file, i.e `{ mode: '755' }`.
### .rename(name)
### strip
#### name
Type: `Number`
Default: `0`
Type: `Function|String`
Equivalent to `--strip-components` for tar.
Rename your files using [gulp-rename](https://github.com/hparra/gulp-rename).
### .run(cb)
#### cb(err, files)
Type: `Function`
The callback will return an array of vinyl files.
## CLI

@@ -92,0 +101,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc