This commit is contained in:
telangpu
2026-04-28 00:42:28 +08:00
parent 2fd1a741cf
commit cf55c2cad6
2522 changed files with 566733 additions and 13 deletions

39
ww_gb_Ticket_temp1/zip.js Normal file
View File

@@ -0,0 +1,39 @@
const fs = require("fs");
const archiver = require("archiver");
// 创建一个输出流到指定的 zip 文件
const output = fs.createWriteStream(__dirname + "/../../zip/ww_gb_Ticket_temp1.zip"); // 这里可以更改为你想要的文件名
const archive = archiver("zip", {
zlib: { level: 9 }, // 设置压缩级别
});
// 监听关闭事件,打印压缩完成信息
output.on("close", function () {
console.log(archive.pointer() + " total bytes");
console.log(
"archiver has been finalized and the output file descriptor has closed."
);
});
// 捕获警告
archive.on("warning", function (err) {
if (err.code === "ENOENT") {
// log warning
} else {
throw err;
}
});
// 捕获错误
archive.on("error", function (err) {
throw err;
});
// 将输出流管道到归档文件
archive.pipe(output);
// 添加目录到归档文件
archive.directory("dist/", false);
// 完成归档
archive.finalize();