Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 0.1.6 to 0.1.7

17

download.js
'use strict';
var decompress = require('decompress');
var forEach = require('async-foreach').forEach;
var eachAsync = require('each-async');
var fs = require('fs');

@@ -29,3 +29,3 @@ var mkdir = require('mkdirp');

forEach(url, function (url) {
eachAsync(url, function (url, index, done) {
opts = opts || {};

@@ -53,7 +53,15 @@ opts.url = url;

if (status < 200 || status >= 300) {
return;
stream.emit('error', status);
}
if (opts.extract && decompress.canExtract(url, mime)) {
end = decompress.extract({ ext: url, path: dest, strip: opts.strip });
var ext;
if (decompress.canExtract(url)) {
ext = url;
} else {
ext = mime;
}
end = decompress.extract({ ext: ext, path: dest, strip: opts.strip });
} else {

@@ -75,2 +83,3 @@ if (!fs.existsSync(dest)) {

stream.emit('close');
done();
});

@@ -77,0 +86,0 @@ });

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

@@ -29,6 +29,6 @@ "keywords": [

"decompress": "~0.1.0",
"each-async": "~0.1.1",
"mkdirp": "~0.3.5",
"request": "~2.25.0",
"through2": "~0.1.0",
"async-foreach": "~0.1.3"
"through2": "~0.1.0"
},

@@ -35,0 +35,0 @@ "devDependencies": {

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

Download a file or an array of files to a given destination.
Download a file or an array of files to a given destination. Returns an EventEmitter
with three possible events — `response`, `data` and `error`.

@@ -35,0 +36,0 @@ ## Options

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