effective-domain-name-parser
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/effective-domain-name-parser package

0.0.11 • Public • Published

devDependency Status

Domain name parser

This is very simple library for Node to parse a domain name into Top Level Domain / Second Level Domain / Subdomains based on the list of effective Top Level Domains maintained by Mozilla.

Install with npm install effective-domain-name-parser.

var domainNameParser = require("effective-domain-name-parser");
console.log(domainNameParser.parse('www.example.com'));
// { tld: "com", sld: "example", "subdomain": "www" }

console.log(domainNameParser.parse('www.example.co.uk'));
// { tld: "co.uk", sld: "example", "subdomain": "www" }

Updating list of effective TLDs

The list of TLDs used by the library is built with node buildPLS.js. This package should get updated each time the list is.

Readme

Keywords

none

Package Sidebar

Install

npm i effective-domain-name-parser

Weekly Downloads

36

Version

0.0.11

License

MIT

Unpacked Size

186 kB

Total Files

5

Last publish

Collaborators

  • dontcallmedom