@zip.js/zip.js
    Preparing search index...

    Interface ZipReaderConstructorOptions

    Represents the options passed to the constructor of ZipReader, and {@link ZipDirectory}#import*.

    interface ZipReaderConstructorOptions {
        checkAmbiguity?: boolean;
        checkOverlappingEntry?: boolean;
        checkOverlappingEntryOnly?: boolean;
        checkPasswordOnly?: boolean;
        checkSignature?: boolean;
        commentEncoding?: string;
        extractAppendedData?: boolean;
        extractPrependedData?: boolean;
        filenameEncoding?: string;
        maxAppendedDataSize?: number;
        passThrough?: boolean;
        password?: string;
        preventClose?: boolean;
        rawPassword?: Uint8Array<ArrayBufferLike>;
        signal?: AbortSignal;
        strictness?: "balanced" | "strict" | "tolerant";
        transferStreams?: boolean;
        useCompressionStream?: boolean;
        useWebWorkers?: boolean;
        decodeText?(value: Uint8Array, encoding: string): string | undefined;
    }

    Hierarchy (View Summary)

    Index
    checkAmbiguity?: boolean

    true to throw an ERR_AMBIGUOUS_ARCHIVE error when calling FileEntry#getData if the local file header of the entry disagrees with its central directory record in a way that could make other tools (e.g. streaming readers based on local file headers) interpret the entry differently. This detects mismatched filenames, general purpose bit flags (encryption, data descriptor and language encoding flags), compression methods, signatures and sizes. The extra fields are not compared because the zip specification allows them to differ.

    false
    
    checkOverlappingEntry?: boolean

    true to throw an ERR_OVERLAPPING_ENTRY error when calling FileEntry#getData if the entry overlaps with another entry on which FileEntry#getData has already been called (with the option checkOverlappingEntry or checkOverlappingEntryOnly set to true).

    false
    
    checkOverlappingEntryOnly?: boolean

    true to throw an ERR_OVERLAPPING_ENTRY error when calling FileEntry#getData if the entry overlaps with another entry on which FileEntry#getData has already been called (with the option checkOverlappingEntry or checkOverlappingEntryOnly set to true) without trying to read the content of the entry.

    false
    
    checkPasswordOnly?: boolean

    true to check only if the password is valid.

    false
    
    checkSignature?: boolean

    true to check the signature of the entry.

    false
    
    commentEncoding?: string

    The encoding of the comment of the entry.

    extractAppendedData?: boolean

    true to extract the appended data into ZipReader#appendedData.

    false
    
    extractPrependedData?: boolean

    true to extract the prepended data into ZipReader#prependedData.

    false
    
    filenameEncoding?: string

    The encoding of the filename of the entry.

    maxAppendedDataSize?: number

    The maximum number of bytes tolerated after the zip structure before the archive is rejected. Defaults to 0 when GetEntriesOptions#strictness is "strict", 65535 when it is "balanced", and Infinity when it is "tolerant".

    An explicit value takes precedence over the strictness default at every level, so it can loosen "strict" or reintroduce a rejection under "tolerant". It also bounds how far back the end of central directory record is searched for, so a value smaller than the amount of data actually appended surfaces an ERR_EOCDR_NOT_FOUND error when the record lies beyond the searched region and an ERR_AMBIGUOUS_ARCHIVE error otherwise.

    passThrough?: boolean

    true to read the data as-is without decompressing it and without decrypting it.

    password?: string

    The password used to decrypt the content of the entry.

    preventClose?: boolean

    true to prevent closing of Writer#writable when calling FileEntry#getData.

    false
    
    rawPassword?: Uint8Array<ArrayBufferLike>

    The password used to encrypt the content of the entry (raw).

    signal?: AbortSignal

    The AbortSignal instance used to cancel the decompression.

    strictness?: "balanced" | "strict" | "tolerant"

    How tolerant the reader should be when the local file header of an entry disagrees with its central directory record. "strict" throws an ERR_AMBIGUOUS_ARCHIVE error (equivalent to ZipReaderOptions#checkAmbiguity set to true); "balanced" and "tolerant" trust the central directory record.

    "balanced"
    
    transferStreams?: boolean

    true to transfer stream ownership to web workers.

    true
    
    useCompressionStream?: boolean

    true to use the native API CompressionStream/DecompressionStream to compress/decompress data.

    true
    
    useWebWorkers?: boolean

    true to use web workers to compress/decompress data in non-blocking background processes.

    true
    
    • The function called for decoding the filename and the comment of the entry.

      Parameters

      • value: Uint8Array

        The raw text value.

      • encoding: string

        The encoding of the text.

      Returns string | undefined

      The decoded text value or undefined if the raw text value should be decoded by zip.js.