Skip to content

capturr/get-root-domain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Extract Root Domain Name

Extract root domain name from an URL.

npm

Installation

npm install --save get-root-domain

Usage

getRootDomain( url: string | URL ): string;

Usage example

import getRootDomain from 'get-root-domain';

console.log(
    getRootDomain('http://www.google.co.uk/blah'), // "google.co.uk"
    getRootDomain('http://www.e.leclerc/test'), // "e.leclerc"
);

About

Extract root domain name from an URL.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published