inspectStream.js 288 B

123456789101112131415
  1. var isStream = require('./isStream');
  2. module.exports = function(stream) {
  3. if (!isStream(stream)) {
  4. return;
  5. }
  6. var streamType = stream.constructor.name;
  7. // Avoid StreamStream
  8. if (streamType === 'Stream') {
  9. streamType = '';
  10. }
  11. return '<' + streamType + 'Stream>';
  12. };