extract-zip
Advanced tools
Comparing version 1.0.2 to 1.0.3
17
index.js
@@ -60,7 +60,20 @@ var fs = require('fs') | ||
var mode = (entry.externalFileAttributes >> 16) & 0xFFFF | ||
// check if it's a symlink (using stat mode constants) | ||
// check if it's a symlink or dir (using stat mode constants) | ||
var IFMT = 61440 | ||
var IFDIR = 16384 | ||
var IFLNK = 40960 | ||
var symlink = (mode & IFMT) === IFLNK | ||
var isDir = (mode & IFMT) === IFDIR | ||
// if no mode then default to readable | ||
if (mode === 0) { | ||
if (isDir) mode = 0555 | ||
else mode = 0444 | ||
} | ||
// reverse umask first (~) | ||
var umask = ~process.umask() | ||
// & with processes umask to override invalid perms | ||
var procMode = mode & umask | ||
zipfile.openReadStream(entry, function(err, readStream) { | ||
@@ -89,3 +102,3 @@ if (err) { | ||
function writeStream() { | ||
var writeStream = fs.createWriteStream(dest, {mode: mode}) | ||
var writeStream = fs.createWriteStream(dest, {mode: procMode}) | ||
readStream.pipe(writeStream) | ||
@@ -92,0 +105,0 @@ writeStream.on('finish', function() { |
{ | ||
"name": "extract-zip", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "unzip a zip file into a directory using 100% pure gluten-free organic javascript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
282769
137