Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ZipOptions

Compression options.

example
const { zipDir } = require('zip');
zipDir('./dir', './dest.zip', {
   compressionLevel: 9,
   password: '123456',
   includeRootFolder: false,
});
see

zipDir

see

zipFiles

see

zipFile

see

ZipFile.addFolder

see

ZipFile.addFile

see

ZipFile.addFiles

Hierarchy

  • ZipOptions

Index

Properties

Optional aesKeyStrength

aesKeyStrength: "AES_STRENGTH_128" | "AES_STRENGTH_192" | "AES_STRENGTH_256"

AES encryption strength, including AES_STRENGTH_128, AES_STRENGTH_192, AES_STRENGTH_256

Optional compressionLevel

compressionLevel: number

Compression level, 0~9, 0 means no compression, 9 is the smallest size (slow). Default is 5 (normal compression).

Optional compressionMethod

compressionMethod: "COMP_STORE" | "COMP_DEFLATE"

Compression method, COMP_STORE means store the file without compression, COMP_DEFLATE means compress (default)

Optional defaultFolderPath

defaultFolderPath: string

Specify the default folder path when compressing or adding files.

Optional encryptionMethod

encryptionMethod: "ENC_NO_ENCRYPTION" | "ENC_METHOD_STANDARD" | "ENC_METHOD_AES"

Encryption method, ENC_NO_ENCRYPTION means no encryption (default), ENC_METHOD_STANDARD means standard encryption, ENC_METHOD_AES means AES encryption

Optional fileNameInZip

fileNameInZip: string

Specify the path and name of the file when compressing or adding file.

see

ZipFile.addFile

see

ZipFile.addFolder

Optional includeRootFolder

includeRootFolder: boolean

Set the flag to indicate whether the root folder will be included in the ZIP. Default is true.

see

ZipFile.addFolder

see

zipDir

Optional password

password: string

Password for encryption. If set password but not set encryption method, the encryption method will be AES.

Optional readHiddenFiles

readHiddenFiles: boolean

Whether to include hidden files when compressing folder. If true, hidden files will be included when compressing folder. Default is true.

Optional rootFolderInZip

rootFolderInZip: string

Set the name of the root folder in the ZIP.

see

ZipFile.addFolder

see

zipDir