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

    3.1.0 • Public • Published

    cross-zip

    Build status

    Fork from https://github.com/feross/cross-zip

    Cross-platform .zip file creation

    Install

    npm install @tybys/cross-zip
    

    Usage

    JavaScript

    const path = require('path')
    const crossZip = require('@tybys/cross-zip')
    
    const input = path.join(__dirname, 'myFolder') // folder to zip
    const output = path.join(__dirname, 'myFile.zip') // name of output zip file
    
    crossZip.zipSync(input, output)

    TypeScript

    import * as path from 'path'
    import * as crossZip from '@tybys/cross-zip'
    
    const input = path.join(__dirname, 'myFolder') // folder to zip
    const output = path.join(__dirname, 'myFile.zip') // name of output zip file
    
    crossZip.zipSync(input, output)

    API

    crossZip.zip(input, output [, includeBaseDirectory])

    Zip the folder or file at input and save it to a .zip file at output.

    includeBaseDirectory: true to include the directory name from input at the root of the archive; false to include only the contents of the directory.

    Return Promise<number> (size of archive).

    crossZip.zipSync(input, output [, includeBaseDirectory])

    Sync version of crossZip.zip.

    crossZip.unzip(input, output)

    Unzip the .zip file at input into the folder at output. Return Promise<void>.

    crossZip.unzipSync(input, output)

    Sync version of crossZip.unzip.

    Windows users

    This package requires .NET Framework 4.5 or later and Powershell 3. These come pre-installed on Windows 8 or later.

    On Windows 7 or earlier, you will need to install these manually in order for cross-zip to function correctly.

    Reference

    License

    MIT.

    Install

    npm i @janpio/cross-zip

    DownloadsWeekly Downloads

    2

    Version

    3.1.0

    License

    MIT

    Unpacked Size

    12.7 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar