extract-zip
Advanced tools
Comparing version 1.1.2 to 1.2.0
11
index.js
@@ -73,6 +73,11 @@ var fs = require('fs') | ||
// if no mode then default to readable | ||
// if no mode then default to default modes | ||
if (mode === 0) { | ||
if (isDir) mode = 365 // 0555 | ||
else mode = 292 // 0444 | ||
if (isDir) { | ||
if (opts.defaultDirMode) mode = parseInt(opts.defaultDirMode, 10) | ||
if (!mode) mode = 493 // Default to 0755 | ||
} else { | ||
if (opts.defaultFileMode) mode = parseInt(opts.defaultFileMode, 10) | ||
if (!mode) mode = 420 // Default to 0644 | ||
} | ||
} | ||
@@ -79,0 +84,0 @@ |
{ | ||
"name": "extract-zip", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "unzip a zip file into a directory using 100% pure gluten-free organic javascript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -10,4 +10,2 @@ # extract-zip | ||
[![build status](http://img.shields.io/travis/maxogden/extract-zip.svg?style=flat)](http://travis-ci.org/maxogden/extract-zip) | ||
## Installation | ||
@@ -31,9 +29,15 @@ | ||
var extract = require('extract-zip') | ||
extract(source, {dir: target}, function(err) { | ||
extract(source, {dir: target}, function (err) { | ||
// extraction is complete. make sure to handle the err | ||
}) | ||
``` | ||
If not specified, `dir` will default to `process.cwd()`. | ||
### Options | ||
- `dir` - defaults to `process.cwd()` | ||
- `defaultDirMode` - integer - Directory Mode (permissions) will default to `493` (octal `0755` in integer) | ||
- `defaultFileMode` - integer - File Mode (permissions) will default to `420` (octal `0644` in integer) | ||
Default modes are only used if no permissions are set in the zip file. | ||
## CLI Usage | ||
@@ -40,0 +44,0 @@ |
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
7418
140
48