Parsing Hostname for TLD, domain name, and SLD
does anyone know of any packages to parse a URL's hostname for the top level domain, domain name, and sublevel domains? I found one, but it actually just doesn't work. It just errors saying the label is too short for everything I give it. https://github.com/lupomontero/psl
GitHub
GitHub - lupomontero/psl: JavaScript domain name parser based on th...
JavaScript domain name parser based on the Public Suffix List - GitHub - lupomontero/psl: JavaScript domain name parser based on the Public Suffix List
5 Replies
I'm suprised this isn't already in the URL object for Javascript
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
no I need the sub level domain of the url, which comes from the
URL.hostname
why not use some regex for that
I just woke up, there may be better ways to do it
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View