Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

splitted-url

ramaiahkethana2.4kISC1.0.20

Use to identify (extract) main domain and hostname from a url. We can also use it as external url checking by comparing domain variable in the result.

split-url, url-spit, maindomain, domain, hostname, host, subdomain, domain name extract, sud domain extractor, is external url, external url, external url checker, external-url

readme

splitted-url

NPM Version NPM Downloads Coverage Status

It will use to identify main domain and hostname from a url

Installing

npm i splitted-url --save

Usage

const splittedUrl = require('splitted-url')

splittedUrl('https://google.com')
// => { host: 'google.com', domain: 'google.com' }

splittedUrl('https://google.co.in')
// => { host: 'google.co.in', domain: 'google.co.in' }

splittedUrl('https://www.google.com')
// => { host: 'www.google.com', domain: 'google.com' }

splittedUrl('https://www.google.co.in')
// => { host: 'www.google.co.in', domain: 'google.co.in' }