2026/4/18小於 1 分鐘
createZip
建立 ZIP 檔案。
語法
createZip(sourcePath: string, zipPath: string): void參數
| 參數名稱 | 類型 | 說明 |
|---|---|---|
sourcePath | string | 要壓縮的資料夾或檔案路徑 |
zipPath | string | ZIP 檔案的路徑 |
// 這將把 source/ 資料夾壓縮成 archive.zip
FilesJS.createZip('source/', 'archive.zip');