2.0.0 • Published 2 years ago

@anchovy_studios/extract-all-zip v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

extract-all-zip

Libraries.io dependency status for latest release npm npm bundle size GitHub issues NPM

Extract all zip within a directory recursively.

Requirement

Node.js 10.0.0 or higher

Installation

Installation is done using the npm install command:

$ npm install @anchovy_studios/extract-all-zip

Quick Start

const { extract } = require('extract-all-zip')

const path = 'path.to.your.folder'
try {
    const files = extract(path)
    console.log(files)
} catch (err) {
    console.error(err)
}

Documentation

Exception

The extract function will throw ExtractException object if there is an error during extraction or the path to the folder is invalid.

To get the exception message you can access its attribute:

try {
    ...
} catch (err) {
    console.error(err.message)
}

To get the native exception object or library dependency exception you can access its attribute:

try {
    ...
} catch (err) {
    console.error(err.errObj)
}

Return

The extract function will return a list of string which is the path of the zip file upon successfull extraction.

[
  'path.to.file-one.zip',
  'path.to.file-two.zip',
  'path.to.file-three.zip'
  ...
]

Dependency

Change History

CHANGELOG

License

MIT

2.0.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago