RunKit + npm:

node v8.17.0
version: 1.0.2
tldjs Node.js module written in JavaScript to work against complex domain names, subdomains and well-known TLDs. Read more about the project on Report any issues or questions on
const {parse, tldExists} = require('tldjs'); // Checking only if TLD exists in URL or hostname // First TLD exists; the second does not. console.log(tldExists('')); console.log(tldExists('tld.unknown')); // Retrieving hostname related informations of a given URL parse('');

no comments

    sign in to comment