### jszip
nodejs 压缩文件使用的是``jszip`
```js
const JSZIP = require('jszip')
const zip = new JSZIP()
// 构建本地Zip文件
function buildZip() {
pushZip(zip, path.resolve(__dirname, './dist'));
zip.generateAsync({
type: 'nodebuffer',
compression: 'DEFLATE',
compressionOptions: {
level: 9
}
}).then(function (content) {
fs.writeFile(path.resolve(__dirname, './dist.zip'), content, err => {
if (err) throw err;
console.log('文件已被保存');
});
});