5

If I have an http server, and I want to write the same output to every request, it seems silly to recreate a new stream on every request. But, I'm noticing that if I pipe a file-stream somewhere for example, trying to pipe it again doesn't do anything.

How can I reuse a stream?

B T
  • 57,525
  • 34
  • 189
  • 207
  • 1
    Ope, I think this answers my question actually: http://stackoverflow.com/questions/19553837/node-js-piping-the-same-stream-into-multiple-writable-targets – B T Sep 04 '14 at 16:42

1 Answers1

-1

You can pipe it into a Transform stream do something with it and push the input to the transform back into the stream towards another transform.

eljefedelrodeodeljefe
  • 6,304
  • 7
  • 29
  • 61