Is there an elegant way to determine if a stream is process.stdout
I am working with streams and will like to end the stream, but found out that if the stream is process.stdout
an error is thrown because process.stdout
is a special stream that cannot be closed. So want to end all streams except it's process.stdout
I tried using a try and catch, but the process.stdout
error ends the node process, ignoring the try and catch.