Node.js zlib create gz file

Description

Node.js zlib create gz file


var fs = require("fs");
var zlib = require('zlib');

fs.createReadStream('input.txt')
  .pipe(zlib.createGzip())//  w  w w. j  a v a  2s. c o m
  .pipe(fs.createWriteStream('input.txt.gz'));



PreviousNext

Related