美文网首页Nodejs
node压缩模块之zip-local

node压缩模块之zip-local

作者: 蘇上方 | 来源:发表于2017-03-20 16:05 被阅读21次

    安装

      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)
        }
    });
    

    相关文章

      网友评论

        本文标题:node压缩模块之zip-local

        本文链接:https://www.haomeiwen.com/subject/leqinttx.html