Extract domain, subdomain and tld from a url
JavaScript Makefile
Switch branches/tags
Nothing to show
Latest commit 0efe5e5 Feb 25, 2016 @masylum bumped version
Failed to load latest commit information.
lib TLD snapshot update Feb 25, 2016
test fixed some bugs Sep 18, 2011
.gitignore ignoring node_modules Sep 17, 2011
Makefile first commit Sep 17, 2011
README.md Update README.md Dec 10, 2011
index.js first commit Sep 17, 2011
package.json bumped version Feb 25, 2016



Accurately separates the gTLD or ccTLD (generic or country code top-level domain) from the registered domain and subdomains of a URL.

How does it work?

var tldextract = require('tldextract');

tldextract('http://forums.news.cnn.com/', function (err, obj) {
  // obj: {subdomain: 'forums.news', domain: 'cnn', tld: 'com'}

tldextract('http://ye.ye.ye.ye/', function (err, obj) {
  // obj: {subdomain: 'ye', domain: 'ye', tld: 'ye.ye'}




This module is a port of the python module tldextract.