Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

为何用zlib的Gzip后的文件更大了?

$
0
0
var fs = require('fs');
var zlib = require('zlib');

fs.createReadStream('input.txt')
	.pipe(zlib.createGzip())
	.pipe(fs.createWriteStream('input.txt.gz'));

console.log('压缩完成');

ls -alh
-rw-r--r--  1 phieo  staff    13B Nov 10 10:24 input.txt
-rw-r--r--  1 phieo  staff    33B Nov 10 10:33 input.txt.gz

Viewing all articles
Browse latest Browse all 14821

Trending Articles