bjarneo / extract-domain

Extract domain name from an URL
https://www.npmjs.com/package/extract-domain
MIT License
31 stars 4 forks source link

extractDomain("https://www.google.co.uk") = "co.uk" #10

Closed dancherb closed 3 years ago

dancherb commented 3 years ago

Thanks for the work - currently this can't be used with multi-part domain endings such as .co.uk or .com.au (and countless others).

bjarneo commented 3 years ago

Hey. Did you try with extractDomain('https://www.google.co.uk', { tld: true })?

bjarneo commented 3 years ago
➜  extract-domain-test cat index.js
const extractDomain = require("extract-domain");

console.log(extractDomain("https://www.google.co.uk", { tld: true }))
➜  extract-domain-test node index.js
google.co.uk

https://github.com/bjarneo/extract-domain#tld-support

dancherb commented 3 years ago

Hey. Did you try with extractDomain('https://www.google.co.uk', { tld: true })?

Oops. Cheers boss