@slimio/unzipper
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Unzipper

Version Maintenance MIT dep size Known Vulnerabilities Build Status Greenkeeper badge

Modern unzipper with support of async/await. This module use yauzl under the hood and has been designed to replace extract-zip.

Requirements

Getting Started

This package is available in the Node Package Repository and can be easily installed with npm or yarn.

$ npm i @slimio/unzipper
# or
$ yarn add @slimio/unzipper

Usage example

const { join } = require("path");
const unzip = require("@slimio/unzipper");

const filePath = "your/zip/file.zip";
await unzip(filePath);
// or
await unzip(filePath, { dir: join(__dirname, "yourDirectory") });

API

Unzipper(filePath: string, options?: Unzipper.ConstructorOptions): void

Extract a zip file

⚠️ dir must be an absolute path.

Available options are described by the following TypeScript interface:

interface ConstructorOptions {
    dir?: string;
    log?: boolean;
}
  • dir : unzip directory target. (Default: process.cwd())
  • log : Log directories and files path (Default: false).

Dependencies

Name Refactoring Security Risk Usage
yauzl ⚠️Major High Unzipper for Node.js

License

MIT

/@slimio/unzipper/

    Package Sidebar

    Install

    npm i @slimio/unzipper

    Weekly Downloads

    7

    Version

    0.2.0

    License

    MIT

    Unpacked Size

    8.15 kB

    Total Files

    5

    Last publish

    Collaborators

    • fraxken
    • alexandre.malaj