@types/unzip

  • Version 0.1.4
  • Published
  • 4.3 kB
  • 1 dependency
  • MIT license

Install

npm i @types/unzip
yarn add @types/unzip
pnpm add @types/unzip

Overview

TypeScript definitions for unzip

Index

Functions

function Extract

Extract: (options: { path: string }) => NodeJS.WritableStream;

    function Parse

    Parse: () => NodeJS.WritableStream;

      Interfaces

      interface Entry

      interface Entry extends stream.PassThrough {}
      • Code example from https://www.npmjs.com/package/unzip with type unzip.Entry added

        fs.createReadStream('path/to/archive.zip')
        .pipe(unzip.Parse())
        .on('entry', function (entry: unzip.Entry) {
        var fileName = entry.path;
        var type = entry.type; // 'Directory' or 'File'
        var size = entry.size;
        if (fileName === "this IS the file I'm looking for") {
        entry.pipe(fs.createWriteStream('output/path'));
        } else {
        entry.autodrain();
        }
        });

      property autodrain

      autodrain: () => void;

        property path

        path: string;

          property size

          size: number;

            property type

            type: 'Directory' | 'File';

              Package Files (1)

              Dependencies (1)

              Dev Dependencies (0)

              No dev dependencies.

              Peer Dependencies (0)

              No peer dependencies.

              Badge

              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/unzip.

              • Markdown
                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/unzip)
              • HTML
                <a href="https://www.jsdocs.io/package/@types/unzip"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>