extract-zip
unzip a zip file into a directory using 100% javascript
Last updated 6 years ago by malept .
BSD-2-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install extract-zip 
SYNC missed versions from official npm registry.

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 Uses JS Standard Style Build Status

Installation

Make sure you have Node 10 or greater installed.

Get the library:

npm install extract-zip --save

Install the command line program:

npm install extract-zip -g

JS API

const extract = require('extract-zip')

async function main () {
  try {
    await extract(source, { dir: target })
    console.log('Extraction complete')
  } catch (err) {
    // handle any errors
  }
}

Options

  • dir (required) - the path to the directory where the extracted files are written
  • defaultDirMode - integer - Directory Mode (permissions), defaults to 0o755
  • defaultFileMode - integer - File Mode (permissions), defaults to 0o644
  • 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().

Current Tags

  • 2.0.1                                ...           latest (4 years ago)

24 Versions

  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           5 years ago
  • 1.7.0                                ...           5 years ago
  • 1.6.8                                ...           5 years ago
  • 1.6.7                                ...           6 years ago
  • 1.6.6                                ...           7 years ago
  • 1.6.5                                ...           7 years ago
  • 1.6.4                                ...           7 years ago
  • 1.6.3                                ...           7 years ago
  • 1.6.2                                ...           7 years ago
  • 1.6.1                                ...           7 years ago
  • 1.6.0                                ...           8 years ago
  • 1.5.0                                ...           9 years ago
  • 1.4.1                                ...           9 years ago
  • 1.4.0                                ...           9 years ago
  • 1.3.0                                ...           9 years ago
  • 1.2.0                                ...           9 years ago
  • 1.1.2                                ...           9 years ago
  • 1.1.1                                ...           9 years ago
  • 1.1.0                                ...           9 years ago
  • 1.0.3                                ...           10 years ago
  • 1.0.2                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (4)

Copyright 2013 - present © cnpmjs.org | Home |