node-7z
A Node.js wrapper for 7-Zip
Usage
I chose to use Promises in this library. API is consistent with standard use:
var Zip = require('7z');
var myTask = new Zip();
myTask.extractFull('myArchive.7z', 'destination', { p: 'myPassword' })
.progress(function (files) {
console.log('Some files are extracted: %s', files);
});
.then(function () {
console.log('Extracting done!');
});
.catch(function (err, code) {
console.error('7-Zip exit with code %i', code);
console.error(err);
});
Installation
You must have the 7z
executable available in your PATH. In some GNU/Linux
distributions install the p7zip-full
.
npm install --save 7z
API
Arguments
archive
The path to the archive you want to analyse.dest
Where to extract the archive.options
An object of options.
Progress
files
A array of all the extracted files AND directories. The /
character is used as a path separator on every platform.
Error
err
An Error object. Its message is the message outputed by 7-Zip.code
7-Zip exit code.
Arguments
archive
The path to the archive you want to analyse.dest
Where to extract the archive.options
An object of options.
Progress
files
A array of all the extracted files AND directories. The /
character is used as a path separator on every platform.
Error
err
An Error object. Its message is the message outputed by 7-Zip.code
7-Zip exit code.
With :heart: from quentinrossetti