安裝
npm install zip-local ^0.3.4 --save-dev
demo
zipper.zip("output/release", function(error, zipped) {
if (!error) {
zipped.compress(); // compress before exporting
var buff = zipped.memory(); // get the zipped file as a Buffer
// or save the zipped file to disk
zipped.save("./" + zipName, function(error) {
if (!error) {
console.log("Ziped files successfully !");
computedHex();
}
});
} else {
console.log(error)
}
});