Skip to content

Get all the top-level domains, including gTLDs such as `.com`, and country-code TLDs such as `.uk`.

License

Notifications You must be signed in to change notification settings

justjavac/deno_domain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deno_domain

tag Build Status license

Get all the top-level domains, including gTLDs such as .com, and country-code TLDs such as .uk.

Usage

All domain code:

import domains from "https://deno.land/x/domain/domains.ts";

console.log(domains);

output:

[
  [".aaa", ".aaa", "generic", "American Automobile Association, Inc."],
  [".aarp", ".aarp", "generic", "AARP"],
  [".abarth", ".abarth", "generic", "Fiat Chrysler Automobiles N.V."],
  [".abb", ".abb", "generic", "ABB Ltd"],
  ...
  ...

Check if the domain code is valid:

import { isValid } from "https://deno.land/x/domain/mod.ts";

isValid(".com"); // true
isValid(".cn"); // true
isValid(".zzzzz"); // false

Get an array with all the domain codes supported:

import { getAlldomainCode } from "https://deno.land/x/domain/mod.ts";

getAlldomainCode(); // [".aaa", ".aarp", ".abarth", ..., ...]

Get domainInfo:

import { getdomainInfo } from "https://deno.land/x/domain/mod.ts";

getdomainInfo(".com");
// { name: ".com", xn: ".com", type: "generic", manager: "VeriSign Global Registry Services" }

getdomainInfo(".中国");
// { name: ".中国", xn: ".xn--fiqs8s", type: "country-code", manager: "China Internet Network Information Center (CNNIC)" }

getdomainInfo(".zzzz");
// null

License

deno_domain is released under the MIT License. See the bundled LICENSE file for details.

About

Get all the top-level domains, including gTLDs such as `.com`, and country-code TLDs such as `.uk`.

Topics

Resources

License

Stars

Watchers

Forks