Skip to content

r.pipe(z).pipe(w) should behave the same as pipeline(r, z, w) #61969

@richytong

Description

@richytong

To me, the r.pipe(z).pipe(w) expression is a pipeline:

const r = fs.createReadStream('file.txt');
const z = zlib.createGzip();
const w = fs.createWriteStream('file.txt.gz');

r.pipe(z).pipe(w);

When a stream is piped to another stream, that should create a pipeline, and be functionally equivalent to the expression pipeline(r, z, w).

const r = fs.createReadStream('file.txt');
const z = zlib.createGzip();
const w = fs.createWriteStream('file.txt.gz');

pipeline(r, z, w);

pipe returning the writable stream is nonintuitive. It should return a new Pipeline object. And perhaps we can deprecate pipeline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions