tldextract

Extract domain, subdomain and tld from a url

npm install tldextract
129 downloads in the last day
1 003 downloads in the last week
3 908 downloads in the last month
npm loves you