@aegenet/belt-extract-domain
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

npm version

@aegenet/belt-extract-domain

Extract domain informations

💾 Installation

yarn add @aegenet/belt-extract-domain@^2.0.0
# or
npm i @aegenet/belt-extract-domain@^2.0.0

📝 Usage

import { extractDomain } from '@aegenet/belt-extract-domain';

extractDomain(undefined)
// null

extractDomain(undefined)
// null

extractDomain('aaa.ooo.com')
// {
//   domain: 'ooo.com',
//   subdomains: [],
// }

extractDomain('aaa.ooo.com')
// {
//   domain: 'ooo.com',
//   subdomains: ['aaa'],
// }

extractDomain('deeper.aaa.ooo.com')
// {
//   domain: 'ooo.com',
//   subdomains: ['aaa', 'deeper'],
// }

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @aegenet/belt-extract-domain

      Weekly Downloads

      2

      Version

      2.2.0

      License

      MIT

      Unpacked Size

      4.45 kB

      Total Files

      7

      Last publish

      Collaborators

      • agenet