tld.js

JavaScript API to work easily with complex domain names, subdomains and well-known TLDs.

tld.js is a Node.js module written in JavaScript to work against complex domain names, subdomains and well-known TLDs.

It answers with accuracy to questions like what is mail.google.com’s domain?, what is a.b.ide.kyoto.jp’s subdomain? and is https://big.data’s TLD a well-known one?.

tld.js runs fast, is fully tested and is safe to use in the browser (with [browserify][], webpack and others). Because it relies on Mozilla’s [public suffix list][], now is a good time to say thank you Mozilla!