publicsuffix written in nodejs ==============================

npm install public-suffix
2 downloads in the last week
7 downloads in the last month

publicsuffix written in nodejs

A "public suffix" is one under which Internet users can directly register names. Some examples of public suffixes are .com, and The Public Suffix List is a list of all known public suffixes.


This is an implementation of the public suffix list from mozilla to work with lists of unfiltered domains.


var PublicSuffix = require('PublicSuffix');
var publicSuffix = PublicSuffix.PublicSuffixFactory();

var getTopLevelDomains =, publicSuffix.getTopDomain);
var realDomains = _.filter(domains, publicSuffix.hasRealTopLevelDomain);


The implementation is creating a tree structure from the domain and has unit tests.


To run the tests just execute

node tests/test-publicsuffix.js

No Unit testing framework is required.


  • underscore
npm loves you