How can I reuse a readable stream in node.js?

If I have an http server and I want to write the same output for every request, it seems silly to recreate a new stream for every request. But, I notice that if I, for example, connect a file stream, trying to reconnect it does nothing.

How can I reuse a stream?

+3


source to share


1 answer


You can stream it to stream Transform

to do something with it, and insert the transform back into the stream to another transform.



0


source







All Articles