extract-zip-promise
v1.0.5
Published
Wrapper arount extract-zip enabling promise interface.
Downloads
296
Maintainers
Readme
Extract Zip Promise
Simple wrapper around extract-zip module, enabling promise interface.
Installation
npm i extract-zip-promise
Usage
const extractZip = require("extract-zip-promise")
//
;(async () => {
try {
await extractZip(archivePath, { dir: "destination/path" })
} catch (e) {
//error extracting zip file
}
})()
Function signature is the same as extract-zip module.
Options object
dir
- defaults toprocess.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