Skip to content

ZIP compression and extraction

Extract the ZIP file to the specified directory.

await SuperSDK.unzipFile('downloads/archive.zip', 'extracted/');

Parameter Description:

ParameterTypeDescription
zipPathstringZIP file path
destPathstringExtract to target directory

Security Limit: ZIP files containing malicious path entries (e.g., ../) will fail to extract and will not write outside the target directory.

Compress the directory into a ZIP file.

await SuperSDK.zipDir('data/logs/', 'backup/logs.zip');

Parameter Description:

ParameterTypeDescription
sourcePathstringDirectory path to be compressed
zipPathstringGenerated ZIP file path

Note: Compression and decompression operations may take a long time, with a timeout of 60 seconds.