Skip to main content

TLD Validator

CI Quality Gate Status Bugs Reliability Rating Security Rating Maintainability Rating Vulnerabilities Lines of Code Ko-Fi

Deno 🦕 module to check if a Top Level Domain(TLD) is valid.

Installation

import { validateTLD } from "https://deno.land/x/tld-validator/mod.ts";

Parameter

  • tld: string - Input tld, the validity of which is to be checked.

Output

Returns true if the tld is valid else false.

Usage

import { validateTLD } from "https://deno.land/x/tld-validator/mod.ts";

const inputTLD = "photo";
const isValidTLD = validateTLD(inputTLD);

if (isValidTLD) {
  console.log(`${inputTLD} is a valid TLD`);
} else {
  console.log(`${inputTLD} is an invalid TLD`);
}

Reference

License

This package is published under the MIT license. For more information, see the accompanying LICENSE file.




PS:

If you find this package useful, please consider giving a star to this project on Github.

And, if you are willing to buy me a coffee, that would be awesome. :)

Buy Me a Coffee at ko-fi.com