ZIP compression and extraction
unzipFile(zipPath, destPath)
Section titled “unzipFile(zipPath, destPath)”Extract the ZIP file to the specified directory.
await SuperSDK.unzipFile('downloads/archive.zip', 'extracted/');Parameter Description:
| Parameter | Type | Description |
|---|---|---|
| zipPath | string | ZIP file path |
| destPath | string | Extract 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.
zipDir(sourcePath, zipPath)
Section titled “zipDir(sourcePath, zipPath)”Compress the directory into a ZIP file.
await SuperSDK.zipDir('data/logs/', 'backup/logs.zip');Parameter Description:
| Parameter | Type | Description |
|---|---|---|
| sourcePath | string | Directory path to be compressed |
| zipPath | string | Generated ZIP file path |
Note: Compression and decompression operations may take a long time, with a timeout of 60 seconds.