@types/archiver

  • Version 6.0.3
  • Published
  • 8.05 kB
  • 1 dependency
  • MIT license

Install

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

Overview

TypeScript definitions for archiver

Index

Functions

function archiver

archiver: typeof archiver;

    function create

    create: (format: string, options?: ArchiverOptions) => Archiver;

      function isRegisteredFormat

      isRegisteredFormat: (format: string) => boolean;
      • Check if the format is already registered.

      function registerFormat

      registerFormat: (format: string, module: Function) => void;

        Classes

        class ArchiverError

        class ArchiverError extends Error {}

          constructor

          constructor(code: string, data: any);

            property code

            code: string;

              property data

              data: any;

                property path

                path?: any;

                  Interfaces

                  interface Archiver

                  interface Archiver extends stream.Transform {}

                    method abort

                    abort: () => this;

                      method append

                      append: (
                      source: stream.Readable | Buffer | string,
                      data?: EntryData | ZipEntryData | TarEntryData
                      ) => this;

                        method directory

                        directory: (
                        dirpath: string,
                        destpath: false | string,
                        data?: Partial<EntryData> | EntryDataFunction
                        ) => this;
                        • if false is passed for destpath, the path of a chunk of data in the archive is set to the root

                        method file

                        file: (filename: string, data: EntryData) => this;

                          method finalize

                          finalize: () => Promise<void>;

                            method glob

                            glob: (
                            pattern: string,
                            options?: GlobOptions,
                            data?: Partial<EntryData>
                            ) => this;

                              method on

                              on: {
                              (event: 'error' | 'warning', listener: (error: ArchiverError) => void): this;
                              (event: 'data', listener: (data: Buffer) => void): this;
                              (event: 'progress', listener: (progress: ProgressData) => void): this;
                              (event: 'close' | 'drain' | 'finish', listener: () => void): this;
                              (event: 'pipe' | 'unpipe', listener: (src: stream.Readable) => void): this;
                              (event: 'entry', listener: (entry: EntryData) => void): this;
                              (event: string, listener: (...args: any[]) => void): this;
                              };

                                method pointer

                                pointer: () => number;

                                  method setFormat

                                  setFormat: (format: string) => this;

                                    method setModule

                                    setModule: (module: Function) => this;
                                      symlink: (filepath: string, target: string, mode?: number) => this;

                                        method use

                                        use: (plugin: Function) => this;

                                          interface CoreOptions

                                          interface CoreOptions {}

                                            property statConcurrency

                                            statConcurrency?: number | undefined;

                                              interface EntryData

                                              interface EntryData {}

                                                property date

                                                date?: Date | string | undefined;
                                                • Sets the entry date

                                                property mode

                                                mode?: number | undefined;
                                                • Sets the entry permissions

                                                property name

                                                name: string;
                                                • Sets the entry name including internal path

                                                property prefix

                                                prefix?: string | undefined;
                                                • Sets a path prefix for the entry name. Useful when working with methods like directory or glob

                                                property stats

                                                stats?: fs.Stats | undefined;
                                                • Sets the fs stat data for this entry allowing for reduction of fs stat calls when stat data is already known

                                                interface ProgressData

                                                interface ProgressData {}

                                                  property entries

                                                  entries: {
                                                  total: number;
                                                  processed: number;
                                                  };

                                                    property fs

                                                    fs: {
                                                    totalBytes: number;
                                                    processedBytes: number;
                                                    };

                                                      interface TarOptions

                                                      interface TarOptions {}

                                                        property gzip

                                                        gzip?: boolean | undefined;

                                                          property gzipOptions

                                                          gzipOptions?: ZlibOptions | undefined;

                                                            interface TransformOptions

                                                            interface TransformOptions {}

                                                              property allowHalfOpen

                                                              allowHalfOpen?: boolean | undefined;

                                                                property decodeStrings

                                                                decodeStrings?: boolean | undefined;

                                                                  property encoding

                                                                  encoding?: string | undefined;

                                                                    property highWaterMark

                                                                    highWaterMark?: number | undefined;

                                                                      property objectmode

                                                                      objectmode?: boolean | undefined;

                                                                        property readableObjectMode

                                                                        readableObjectMode?: boolean | undefined;

                                                                          property writeableObjectMode

                                                                          writeableObjectMode?: boolean | undefined;

                                                                            interface ZipEntryData

                                                                            interface ZipEntryData extends EntryData {}

                                                                              property store

                                                                              store?: boolean | undefined;
                                                                              • Sets the compression method to STORE

                                                                              interface ZipOptions

                                                                              interface ZipOptions {}

                                                                                property comment

                                                                                comment?: string | undefined;

                                                                                  property forceLocalTime

                                                                                  forceLocalTime?: boolean | undefined;

                                                                                    property forceZip64

                                                                                    forceZip64?: boolean | undefined;

                                                                                      property namePrependSlash

                                                                                      namePrependSlash?: boolean | undefined;
                                                                                      • false

                                                                                      property store

                                                                                      store?: boolean | undefined;

                                                                                        property zlib

                                                                                        zlib?: ZlibOptions | undefined;

                                                                                          Type Aliases

                                                                                          type ArchiverOptions

                                                                                          type ArchiverOptions = CoreOptions & TransformOptions & ZipOptions & TarOptions;

                                                                                            type EntryDataFunction

                                                                                            type EntryDataFunction = (entry: EntryData) => false | EntryData;
                                                                                            • A function that lets you either opt out of including an entry (by returning false), or modify the contents of an entry as it is added (by returning an EntryData)

                                                                                            type Format

                                                                                            type Format = 'zip' | 'tar';

                                                                                              type TarEntryData

                                                                                              type TarEntryData = EntryData;

                                                                                                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/archiver.

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