Skip to main content
Module

x/zipjs/index.js>ZipWriterConstructorOptions

JavaScript library to zip and unzip files supporting multi-core compression, compression streams, zip64, split files and encryption.
Go to Latest
interface ZipWriterConstructorOptions
import { type ZipWriterConstructorOptions } from "https://deno.land/x/zipjs@v2.7.42/index.js";

Represents options passed to the constructor of ZipWriter, ZipWriter#add and [ZipDirectoryEntry](https://deno.land/x/zipjs@v2.7.42/index.js?s=ZipDirectoryEntry)#export*.

Properties

optional
zip64: boolean

true to use Zip64 to store the entry.

zip64 is automatically set to true when necessary (e.g. compressed data larger than 4GB or with unknown size).

optional
preventClose: boolean

true to prevent closing of WritableWriter#writable.

optional
level: number

The level of compression.

The minimum value is 0 and means that no compression is applied. The maximum value is 9.

optional
bufferedWrite: boolean

true to write entry data in a buffer before appending it to the zip file.

bufferedWrite is automatically set to true when compressing more than one entry in parallel.

optional
keepOrder: boolean

true to keep the order of the entry physically in the zip file.

When set to true, the use of web workers will be improved. However, it also prevents files larger than 4GB from being created without setting the zip54 option to true explicitly. Another solution to improve the use of web workers is to add entries from smallest to largest in uncompressed size.

optional
password: string

The password used to encrypt the content of the entry.

optional
rawPassword: Uint8Array

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

optional
encryptionStrength: 1 | 2 | 3

The encryption strength (AES).

optional
signal: AbortSignal

The AbortSignal instance used to cancel the compression.

optional
lastModDate: Date

The last modification date.

optional
lastAccessDate: Date

The last access date.

This option is ignored if the ZipWriterConstructorOptions#extendedTimestamp option is set to false.

optional
creationDate: Date

The creation date.

This option is ignored if the ZipWriterConstructorOptions#extendedTimestamp option is set to false.

optional
extendedTimestamp: boolean

true to store extended timestamp extra fields.

When set to false, the maximum last modification date cannot exceed November 31, 2107 and the maximum accuracy is 2 seconds.

optional
zipCrypto: boolean

true to use the ZipCrypto algorithm to encrypt the content of the entry.

It is not recommended to set zipCrypto to true because the ZipCrypto encryption can be easily broken.

optional
version: number

The "Version" field.

optional
versionMadeBy: number

The "Version made by" field.

optional
dataDescriptor: boolean

true to to add a data descriptor.

When set to false, the ZipWriterConstructorOptions#bufferedWrite option will automatically be set to true.

optional
dataDescriptorSignature: boolean

true to add the signature of the data descriptor.

optional
msDosCompatible: boolean

true to write EntryMetaData#externalFileAttribute in MS-DOS format for folder entries.

optional
externalFileAttribute: number

The external file attribute.

optional
internalFileAttribute: number

The internal file attribute.

optional
supportZip64SplitFile: boolean

false to never write disk numbers in zip64 data.

optional
usdz: boolean

trueto produce zip files compatible with the USDZ specification.

Methods

optional
encodeText(text: string): Uint8Array

Encode the filename and the comment of the entry.