有沒有一種簡單的方法可以創建一個 zip 文件并在 nodejs 中向其中添加一個文件?我發現了大量描述以下內容的示例:var zip = new JSZip();zip.file("Hello.txt", "Hello World\n");我需要做的是1. create a zip file2. add an existing file, not a block of text 3. save the file我曾經使用以下代碼在 python 中執行此操作with ZipFile('myzipfile.zip', 'w') as zip_write: zip_write.write('myfile.txt')節點相當于創建一個 zip 文件并向其中添加一個現有文件?
Nodejs:如何使用現有文件創建 zip 文件
HUH函數
2023-01-06 15:52:43