Socket
Socket
Sign inDemoInstall

download

Package Overview
Dependencies
78
Maintainers
4
Versions
70
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.2.3 to 6.2.4

17

index.js

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

const pEvent = require('p-event');
const fileType = require('file-type');

@@ -19,3 +20,3 @@ const fsP = pify(fs);

const getFilename = res => {
const getFilename = (res, data) => {
const header = res.headers['content-disposition'];

@@ -31,3 +32,13 @@

return filenameFromPath(res);
let filename = filenameFromPath(res);
if (!path.extname(filename)) {
const type = fileType(data);
if (type) {
filename = `${filename}.${type.ext}`;
}
}
return filename;
};

@@ -67,3 +78,3 @@

const filename = opts.filename || filenamify(getFilename(res));
const filename = opts.filename || filenamify(getFilename(res, data));
const outputFilepath = path.join(output, filename);

@@ -70,0 +81,0 @@

3

package.json
{
"name": "download",
"version": "6.2.3",
"version": "6.2.4",
"description": "Download and extract files",

@@ -32,2 +32,3 @@ "license": "MIT",

"decompress": "^4.0.0",
"file-type": "5.2.0",
"filenamify": "^2.0.0",

@@ -34,0 +35,0 @@ "get-stream": "^3.0.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