get-apex-domain-name

0.2.0 • Public • Published

get-apex-domain-name

Robustly parses the root / apex domain name of a URL without the TLD.

NPM Build Status JavaScript Style Guide

Install

npm install --save get-apex-domain-name

Usage

const getApexDomainName = require('get-apex-domain-name')
 
getApexDomainName('https://example.com') // 'example'
getApexDomainName('example.com') // 'example'
getApexDomainName('example.co.uk') // 'example'
getApexDomainName('https://example.dev/sub/path?foo=bar&nala=cat') // 'example'
getApexDomainName('') // null

License

MIT © Travis Fischer

Support my OSS work by following me on twitter twitter

Readme

Keywords

none

Package Sidebar

Install

npm i get-apex-domain-name

Weekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

183 kB

Total Files

21

Last publish

Collaborators

  • fisch0920