code: function normalizePort(val) {
    const normalizedPort = parseInt(val, 10);
  
    if (isNaN(normalizedPort)) {
      // named pipe
      return val;
    }
  
    if (normalizedPort >= 0) {
      // port number
      return normalizedPort;
    }
  
    return false;
  }
docs: Normalize a port into a number, string, or false.