code: function epipeError(err) {
    if (err.code === 'EPIPE' || err.errno === 32) return process.exit;
  
    if (process.stdout.listeners('error').length <= 1) {
      process.stdout.removeAllListeners();
      process.stdout.emit('error', err);
      process.stdout.on('error', epipeError);
    }
  }
docs: Handle EPIPE errors when user doesn't put quotes around output file name with parameters