normalize-domain

Given a url, returns the fully qualified domain name.

Usage no npm install needed!

<script type="module">
  import normalizeDomain from 'https://cdn.skypack.dev/normalize-domain';
</script>

README

normalize-domain

Given a url, returns the fully qualified domain name.

Installation

npm i normalize-domain --save

Usage

const normalize = require('normalize-domain')

normalize('https://www.google.com') 
// => google.com

normalize('www.google.com') 
// => google.com

normalize('https://firebase.google.com/') 
// => firebase.google.com