1.6.7 • Published 6 years ago
extract-zip-forked v1.6.7
extract-zip
Unzip written in pure JavaScript. Extracts a zip into a directory. Available as a library or a command line program.
Uses the yauzl ZIP parser.
Installation
Get the library:
npm install extract-zip --saveInstall the command line program:
npm install extract-zip -gJS API
var extract = require('extract-zip')
extract(source, {dir: target}, function (err) {
// extraction is complete. make sure to handle the err
})Options
dir- defaults toprocess.cwd()defaultDirMode- integer - Directory Mode (permissions) will default to493(octal0755in integer)defaultFileMode- integer - File Mode (permissions) will default to420(octal0644in integer)onEntry- function - if present, will be called with(entry, zipfile), entry is every entry from the zip file forwarded from theentryevent from yauzl.zipfileis theyauzlinstance
Default modes are only used if no permissions are set in the zip file.
CLI Usage
extract-zip foo.zip <targetDirectory>If not specified, targetDirectory will default to process.cwd().
1.6.7
6 years ago
