Closed jamestalmage closed 8 years ago
Didn't know that streams were somewhat "mutable" in a way. Thought that .pipe()
would stay the same no matter what encoding you listen on.
PR looks good :+1:
.pipe()
does stay the same regardless of setEncoding
.
It's stream.on('data', ...)
that is affected.
Oh, then I guess it's what I expected :).
Calling setEncoding on the provided stream affects the data other listeners will see.
This side effect can be avoided by first piping to a PassThrough stream.