joyent/node — Issue #2858: Can a writeable stream have pipe function?
Author: xqiu
Created: 2012-03-02 00:34:32+00:00
State: open

In http://nodejs.org/docs/latest/api/zlib.html#zlib , there is example that pipe return can go to another pipe:

var gzip = zlib.createGzip();
var fs = require('fs');
var inp = fs.createReadStream('input.txt');
var out = fs.createWriteStream('input.txt.gz');

inp.pipe(gzip).pipe(out);

But in http://nodejs.org/docs/latest/api/streams.html , documentation said pipe returns a writeable stream, and writable stream does not have pipe function (readable stream has).

Is this a documentation bug?

Thanks.