📅  最后修改于: 2022-03-11 15:03:39.592000             🧑  作者: Mango
const fs = require('fs');
const r = fs.createReadStream('file.txt');
const z = zlib.createGzip();
const w = fs.createWriteStream('file.txt.gz');
r.pipe(z).pipe(w);