@8zip/core
Simple wrapper around the 7zip binary
Usage
npm i @8zip/core
yarn add @8zip/core
pnpm add @8zip/core
const { extract, compress } = require('@8zip/core')
await extract('path/to/file.7z', 'path/to/extract/to', {
/*
Whether to overwrite files when extracting
The following options are supported:
true | false | "renameExtracting" | "renameExisting"
optional, defaults to true
*/
overwrite: true,
/*
Path to the 7zip binary
optional, defaults to the binary shipped with @8zip/bin
*/
binary: 'path/to/@8zip/bin/dist/7z'
})
await compress('path/to/file.7z', 'path/to/compress', {
/*
Compression level (0-9)
Higher levels result in smaller files, but take longer to compress
optional, defaults to 6
*/
level: 6,
/*
Path to the 7zip binary
optional, defaults to the binary shipped with @8zip/bin
*/
binary: 'path/to/@8zip/bin/dist/7z'
})