var fs = require('fs');
//读取文件流
var myReadStream = fs.createReadStream(__dirname + '/ReadGame.txt');
//写入文件流
var myWriteStream = fs.createWriteStream(__dirname + '/writeGame.txt');
myReadStream.pipe(myWriteStream);
//链式流
var fs = require("fs");
var zlib = require('zlib');
// 压缩 input.txt 文件为 input.txt.gz
fs.createReadStream('ReadGame.txt')
.pipe(zlib.createGzip())
.pipe(fs.createWriteStream('ReadGame.txt.gz'));
console.log("文件压缩完成。");