Deno 🦕 module to check if a Top Level Domain(TLD) is valid.
import { validateTLD } from "https://deno.land/x/tld-validator/mod.ts";
tld: string
- Input tld, the validity of which is to be checked.
Returns true
if the tld is valid else false
.
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`);
}
This package is published under the MIT license. For more information, see the accompanying LICENSE file.
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. :)