@8zip/core
TypeScript icon, indicating that this package has built-in type declarations

23.1.6 • Public • Published

@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'
})

Readme

Keywords

none

Package Sidebar

Install

npm i @8zip/core

Weekly Downloads

1

Version

23.1.6

License

LGPL-3.0-only

Unpacked Size

2.81 kB

Total Files

4

Last publish

Collaborators

  • dissociating