rvagg/isstream — pull request #1 by substack (2014-04-07 01:46:13+00:00)
Title: detect .pipe instead of using instanceof

Using instanceof is problematic since it means that any compatible alt streams implementations that would interface cleanly with core streams won't be properly detected.

In a browser context, importing stream just to check instanceof is especially problematic since you end up with multiple different copies of stream implementations, duplicating many bytes over the wire.

Instead, I propose just making sure that `obj` is an object and that it has a `pipe` method that is a function. Where I have written this functionality elsewhere, that approach has proved plenty adequate.