Piping To Same Writable Stream Twice Via Different Readable Stream
I am trying to concatenate a string and a Readable stream (the readable stream is pointing to a file which may have data in multiple chunks, i.e. the file may be large) into one wr
Solution 1:
Found the reason why was the second piping to the writable stream w
wasn't working.
When the first .pipe(w) finishes, the writable at w is also automatically closed.
So instead of using s.pipe(zlib.createGzip()).pipe(w);
I should have used:
s.pipe(zlib.createGzip()).pipe(w, {end: false});
Where the {end: false} is passed to pipe() as the second argument, stating that the writable should not get closed when the piping is done.
Post a Comment for "Piping To Same Writable Stream Twice Via Different Readable Stream"