rootExtract.js takes a URL string parses it and returns a URL object with a rootDomain field.
- Supports Mexican and Australian web links ✅
npm install rootextract.js
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'