JS Get Sitio web Nombre corto

function extractWebsiteName(url) {
  let name = url.replace(/(http(s)?):\/\//, '')

  name = name.replace('www.', '')

  name = name.split('/')[0].split(':')[0]

  return name
}
florinrelea