var fs = require('fs');
var zlib = require('zlib');
fs.createReadStream('input.txt')
.pipe(zlib.createGzip())
.pipe(fs.createWriteStream('input.txt.gz'));
console.log("Success");
转载请注明:谷谷点程序 » node.js打包压缩包的简单方法
var fs = require('fs');
var zlib = require('zlib');
fs.createReadStream('input.txt')
.pipe(zlib.createGzip())
.pipe(fs.createWriteStream('input.txt.gz'));
console.log("Success");
转载请注明:谷谷点程序 » node.js打包压缩包的简单方法