Skip to content
Zip extraction written in pure JavaScript. Extracts a zip into a directory.
Branch: master
Clone or download
Latest commit 422a39f May 24, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test Use tape methods instead of throwing May 1, 2017
.gitignore 1.0.0 Oct 17, 2014
.npmignore
.travis.yml
CONTRIBUTING.md
LICENSE Add LICENSE Oct 31, 2017
cli.js standard style and remove unused deps Sep 16, 2015
index.js Ensure the directory of the zip entry exists before running realpath Apr 30, 2017
package.json 1.6.7 May 24, 2018
readme.md

readme.md

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.

NPM js-standard-style Build Status

Installation

Get the library:

npm install extract-zip --save

Install the command line program:

npm install extract-zip -g

JS API

var extract = require('extract-zip')
extract(source, {dir: target}, function (err) {
 // extraction is complete. make sure to handle the err
})

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)
  • onEntry - function - if present, will be called with (entry, zipfile), entry is every entry from the zip file forwarded from the entry event from yauzl. zipfile is the yauzl instance

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().

You can’t perform that action at this time.