I have a function which receives an object that could be a string
, Buffer
or Stream
.
I can easily test if the object is a Buffer like so:
if (x instanceof Buffer)
What's the best way to test if an object is a Stream? There doesn't appear to be a Stream base class in node - is there?
What should I look for?