Extract an archive to the specified destination.
algorithm
<String>
: select the algorithm to use, values possible are:7z
,zip
,tar
parameters
<Object>
: parameters object to sendarchive
<String>
: archive to extract. (global)destination
<String>
: directory to extract the files. (global)password
<String>
: password to use to compress the archive. (7z
only)
callback
<Function>
error
<Error>
progressCallback
<Function>
progress
<Object>
: progress informationtotal
<Number>
: total bytes to compress (Windows only)progress
<Number>
: progressratio
<Number>
: compression ratio (Windows only)fileProcessed
<String>
: file currently processed (on Linux and Mac it seems not accurate)
const sevenzip = require('@steezcram/sevenzip');
// By set the destination as a directory, the archive name will be: test.7z
sevenzip.extract('7z', {archive: 'C:\\Users\\public\\Desktop\\test.7z', destination: 'C:\\Users\\tcroi\\Desktop\\test'}, (error) => {
if (error) throw error;
}, (progress) => {
console.log(progress);
});
const sevenzip = require('@steezcram/sevenzip');
// By set the destination as a directory, the archive name will be: test.7z
const error = await sevenzip.extract('7z', {archive: 'C:\\Users\\public\\Desktop\\test.7z', destination: 'C:\\Users\\tcroi\\Desktop\\test'}, null, (progress) => {
console.log(progress);
});
if (error) throw error;