Pipe Interface sample

this is really cool about the Pipe Interface
you can just chain them together to get your job done.😍

1
2
3
4
var r = fs.createReadStream('file.txt')
var z = zlib.createGzip()
var w = fs.createWriteStream('file.txt.gz')
r.pipe(z).pipe(w)