Interface: ZipOptions
CloudControl Pro 9 Docs / zip / ZipOptions
Interface: ZipOptions
zip.ZipOptions
Compression options.
Example
const { zipDir } = require('zip');
zipDir('./dir', './dest.zip', {
compressionLevel: 9,
password: '123456',
includeRootFolder: false,
});
See
Table of contents
Properties
- aesKeyStrength
- compressionLevel
- compressionMethod
- defaultFolderPath
- encryptionMethod
- fileNameInZip
- includeRootFolder
- password
- readHiddenFiles
- rootFolderInZip
Properties
aesKeyStrength
• Optional
aesKeyStrength: "AES_STRENGTH_128"
| "AES_STRENGTH_192"
| "AES_STRENGTH_256"
AES encryption strength, including AES_STRENGTH_128
, AES_STRENGTH_192
, AES_STRENGTH_256
compressionLevel
• Optional
compressionLevel: number
Compression level, 0~9, 0 means no compression, 9 is the smallest size (slow). Default is 5 (normal compression).
compressionMethod
• Optional
compressionMethod: "COMP_STORE"
| "COMP_DEFLATE"
Compression method, COMP_STORE
means store the file without compression, COMP_DEFLATE
means compress (default)
defaultFolderPath
• Optional
defaultFolderPath: string
Specify the default folder path when compressing or adding files.
encryptionMethod
• Optional
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
fileNameInZip
• Optional
fileNameInZip: string
Specify the path and name of the file when compressing or adding file.
See
includeRootFolder
• Optional
includeRootFolder: boolean
Set the flag to indicate whether the root folder will be included in the ZIP. Default is true.
See
password
• Optional
password: string
Password for encryption. If set password but not set encryption method, the encryption method will be AES.
readHiddenFiles
• Optional
readHiddenFiles: boolean
Whether to include hidden files when compressing folder. If true, hidden files will be included when compressing folder. Default is true.
rootFolderInZip
• Optional
rootFolderInZip: string
Set the name of the root folder in the ZIP.
See