tldextract

Extract domain, subdomain and tld from a url

npm install tldextract
147 downloads in the last day
996 downloads in the last week
4 321 downloads in the last month
npm loves you