Socket
Socket
Sign inDemoInstall

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 0.1.5 to 0.1.6

4

download.js

@@ -18,2 +18,3 @@ 'use strict';

* - `mode` Set mode on the downloaded files
* - `strip` Equivalent to --strip-components for tar
*

@@ -33,2 +34,3 @@ * @param {String|Array} url

opts.dest = path.join(dest, path.basename(url));
opts.strip = opts.strip || '0';

@@ -56,3 +58,3 @@ var req = request.get(opts)

if (opts.extract && decompress.canExtract(url, mime)) {
end = decompress.extract({ ext: mime, path: dest });
end = decompress.extract({ ext: url, path: dest, strip: opts.strip });
} else {

@@ -59,0 +61,0 @@ if (!fs.existsSync(dest)) {

{
"name": "download",
"version": "0.1.5",
"version": "0.1.6",
"description": "Download and extract files effortlessly",

@@ -5,0 +5,0 @@ "keywords": [

@@ -18,6 +18,6 @@ # download [![Build Status](https://secure.travis-ci.org/kevva/download.png?branch=master)](http://travis-ci.org/kevva/download)

// download and extract `foo.tar.gz` into `bar/`
download('foo.tar.gz', 'bar', { extract: true; });
download('foo.tar.gz', 'bar', { extract: true });
// download and save `foo.exe` into `bar/foo.exe` with mode `0755`
download('foo.exe', 'bar', { mode: 0755 });
download('foo.exe', 'bar', { mode: '0755' });

@@ -37,3 +37,5 @@ // download and save an array of files in `bar/`

* `extract` — If set to `true`, try extracting the file using [decompress](https://github.com/kevva/decompress/).
* `extract` — If set to `true`, try extracting the file using [decompress](https://github.com/kevva/decompress/)
* `mode` — Set mode on the downloaded files
* `strip` — Equivalent to `--strip-components` for tar

@@ -40,0 +42,0 @@ You can also define options accepted by the [request](https://github.com/mikeal/request/) module.

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc