Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justjavac/deno_domain
Get all the top-level domains, including gTLDs such as `.com`, and country-code TLDs such as `.uk`.
https://github.com/justjavac/deno_domain
deno deno-mod deno-module deno-modules denomod domain domains
Last synced: about 1 month ago
JSON representation
Get all the top-level domains, including gTLDs such as `.com`, and country-code TLDs such as `.uk`.
- Host: GitHub
- URL: https://github.com/justjavac/deno_domain
- Owner: justjavac
- License: mit
- Created: 2020-08-12T01:01:00.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-12T09:51:32.000Z (over 2 years ago)
- Last Synced: 2024-09-16T14:38:42.547Z (about 2 months ago)
- Topics: deno, deno-mod, deno-module, deno-modules, denomod, domain, domains
- Language: TypeScript
- Homepage: https://deno.land/x/domain
- Size: 45.9 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# deno_domain
[![tag](https://img.shields.io/github/release/justjavac/deno_domain)](https://github.com/justjavac/deno_domain/releases)
[![Build Status](https://github.com/justjavac/deno_domain/workflows/ci/badge.svg?branch=master)](https://github.com/justjavac/deno_domain/actions)
[![license](https://img.shields.io/github/license/justjavac/deno_domain)](https://github.com/justjavac/deno_domain/blob/master/LICENSE)Get all the [top-level domains](https://www.iana.org/domains/root/db), including
gTLDs such as `.com`, and country-code TLDs such as `.uk`.## Usage
All domain code:
```ts
import domains from "https://deno.land/x/domain/domains.ts";console.log(domains);
```output:
```ts
[
[".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:
```ts
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:
```ts
import { getAlldomainCode } from "https://deno.land/x/domain/mod.ts";getAlldomainCode(); // [".aaa", ".aarp", ".abarth", ..., ...]
```Get domainInfo:
```ts
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](https://github.com/justjavac/deno_domain) is released under the
MIT License. See the bundled [LICENSE](./LICENSE) file for details.