domain-parser

Getting the domain name without subdomains.

Usage no npm install needed!

<script type="module">
  import domainParser from 'https://cdn.skypack.dev/domain-parser';
</script>

README

node-domain-parser

A simple domain parser, getting the domain name without subdomains.

Build Status

install

npm

npm install domain-parser

usage

var dp = require('domain-parser');

var result = dp('www.google.com.tw').domainName;
console.log(result);
// google.com.tw

result = dp('direct.jp-bank.japanpost.jp').domainName;
console.log(result);
// japanpost.jp

license

MIT