rootextract.js
v1.0.5
Published
A simple function to extract the root domain from an url.
Downloads
2
Readme
Simple package to extract the root domain from an URL
rootExtract.js takes a URL string parses it and returns a URL object with a rootDomain field.
Features
- Supports Mexican and Australian web links :white_check_mark:
How to install
npm install rootextract.js
How to use
Use it in your app
const rooter = require('rootextract.js')
const url = rooter.parse('http://www.example.co.uk')
//We return the normal URL object with an appended rootDomain field.
console.log(url.rootDomain)
//Prints out 'example.co.uk'