What steps will reproduce the bug?
const stream = require('stream');
// two different transforms (these work)
const transform_double = new stream.Transform({
transform(chunk, encoding, callback) {
this.push(chunk);
this.push(chunk);
callback();
}
});
const transform_uppercase = new stream.Transform({
transform(chunk, encoding, callback) {
this.push(chunk.toString().toUpperCase());
callback();
}
});
// compose the transforms
const parser = stream.pipeline(transform_double, transform_uppercase, ()=>0);
// run stdin through it
process.stdin.pipe(parser).pipe(process.stdout);
Then pipe some text to it eg: echo "foo" | node reproduce.js
How often does it reproduce? Is there a required condition?
always
What is the expected behavior?
The text sent in should go through both transformations, eg output "FOOFOO"
What do you see instead?
The text piped in is only sent to the last transformation, eg output "FOO"
Additional information
The docs here don't say what this function returns:
https://nodejs.org/api/stream.html#stream_stream_pipeline_streams_callback
I'm saying that it should return a duplex stream so I can read and write to the ends of the pipeline.
What steps will reproduce the bug?
Then pipe some text to it eg:
echo "foo" | node reproduce.jsHow often does it reproduce? Is there a required condition?
always
What is the expected behavior?
The text sent in should go through both transformations, eg output "FOOFOO"
What do you see instead?
The text piped in is only sent to the last transformation, eg output "FOO"
Additional information
The docs here don't say what this function returns:
https://nodejs.org/api/stream.html#stream_stream_pipeline_streams_callback
I'm saying that it should return a duplex stream so I can read and write to the ends of the pipeline.