📜  使用 node.js 将密码放入 zip 文件 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:50.448000             🧑  作者: Mango

代码示例1
var fs = require("fs");
var Minizip = require('minizip-asm.js');
/*
https://www.npmjs.com/package/minizip-asm.js
*/

var text = new Buffer("HI!");
var mz = new Minizip();

mz.append("Folder/Readme.txt", text, { password: "secret" });
fs.writeFileSync("Test.zip", new Buffer(mz.zip()));