index.js 506 B

1234567891011121314
  1. module.exports = function(stream) {
  2. if (stream.readable && typeof stream.resume === 'function') {
  3. var state = stream._readableState;
  4. if (!state || state.pipesCount === 0) {
  5. // Either a classic stream or streams2 that's not piped to another destination
  6. try {
  7. stream.resume();
  8. } catch (err) {
  9. console.error("Got error: " + err);
  10. // If we can't, it's not worth dying over
  11. }
  12. }
  13. }
  14. };