npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gtlds

v3.0.0

Published

A list of all gGTLD names from the ICANN registry.

Readme

gtlds CI codecov

gTLD utilities

A list of all gTLDs from the ICANN registry, including the registry operator and whether the gTLD has been terminated.

The list is a JSON file and can be used anywhere.

Install

$ npm install gtlds

Usage

import gtlds from 'gtlds';

// Check if a TLD exists in the ICANN registry (including terminated)
gtlds.isGtld('com');
//=> true

gtlds.isGtld('abarth'); // Terminated contract
//=> true

// Check if a TLD is currently active (not terminated)
gtlds.isActiveGtld('com');
//=> true

gtlds.isActiveGtld('abarth'); // Terminated contract
//=> false

gtlds.isActiveGtld('.org');
//=> true

gtlds.isActiveGtld('invalid');
//=> false

// Get detailed information about a gTLD
gtlds.getInfo('google');
/*
{
  contractTerminated: false,
  gTLD: 'google',
  registryOperator: 'Charleston Road Registry Inc.'
}
*/

gtlds.getInfo('abarth'); // Terminated
/*
{
  contractTerminated: true,
  gTLD: 'abarth',
  registryOperator: null
}
*/

gtlds.getInfo('invalid');
//=> null

// Get a random active gTLD
gtlds.random();
/*
{
  "contractTerminated": false,
  "gTLD": "google",
  "registryOperator": "Charleston Road Registry Inc."
}
*/

// Access the data
gtlds.all.length;        // 1,275 (all gTLDs including terminated)
gtlds.active.length;     // 1,120 (active gTLDs only)
gtlds.names.length;      // 1,275 (all gTLD names)
gtlds.activeNames.length; // 1,120 (active gTLD names only)

Note: This package is ESM-only and requires Node.js 18 or higher.

Active vs All gTLDs

This package distinguishes between all gTLDs (historical registry) and active gTLDs (currently operational):

  • All gTLDs (1,275): Includes all gTLDs ever registered with ICANN, even those with terminated contracts
  • Active gTLDs (1,120): Only gTLDs with active contracts that are currently operational

155 gTLDs have terminated contracts and are no longer operational (e.g., .abarth, .bentley, .adac). Use isActiveGtld() for validation in production applications.

API

.all

Type: Array

All gTLDs in the ICANN registry, including those with terminated contracts.

.active

Type: Array

Active gTLDs only (excludes terminated contracts).

.names

Type: Array

All gTLD names, including terminated contracts.

.activeNames

Type: Array

Active gTLD names only (excludes terminated contracts).

.random()

Type: Function

Returns a random active gTLD (excludes terminated contracts).

.isGtld(tld)

Type: Function

Check if a given string exists in the ICANN gTLD registry (includes terminated contracts).

Parameters

  • tld (string): The TLD to check (with or without leading dot, case-insensitive)

Returns

boolean - true if the TLD exists in the registry, false otherwise

Example

import gtlds from 'gtlds';

gtlds.isGtld('com');      // true
gtlds.isGtld('.org');     // true
gtlds.isGtld('GOOGLE');   // true
gtlds.isGtld('abarth');   // true (terminated, but in registry)
gtlds.isGtld('invalid');  // false

.isActiveGtld(tld)

Type: Function

Check if a given string is an active gTLD (excludes terminated contracts). Recommended for production validation.

Parameters

  • tld (string): The TLD to check (with or without leading dot, case-insensitive)

Returns

boolean - true if the TLD is active, false otherwise

Example

import gtlds from 'gtlds';

gtlds.isActiveGtld('com');      // true
gtlds.isActiveGtld('.org');     // true
gtlds.isActiveGtld('GOOGLE');   // true
gtlds.isActiveGtld('abarth');   // false (terminated)
gtlds.isActiveGtld('invalid');  // false

.getInfo(tld)

Type: Function

Get detailed information about a gTLD, including registry operator and contract status.

Parameters

  • tld (string): The TLD to look up (with or without leading dot, case-insensitive)

Returns

object|null - gTLD object with the following properties, or null if not found:

  • gTLD (string): The gTLD name
  • contractTerminated (boolean): Whether the contract is terminated
  • registryOperator (string|null): The registry operator name, or null if terminated

Example

import gtlds from 'gtlds';

gtlds.getInfo('google');
// {
//   contractTerminated: false,
//   gTLD: 'google',
//   registryOperator: 'Charleston Road Registry Inc.'
// }

gtlds.getInfo('.COM');  // Case-insensitive
// {
//   contractTerminated: false,
//   gTLD: 'com',
//   registryOperator: 'VeriSign, Inc.'
// }

gtlds.getInfo('abarth');  // Terminated
// {
//   contractTerminated: true,
//   gTLD: 'abarth',
//   registryOperator: null
// }

gtlds.getInfo('invalid');  // null

Updating

A node script is available to sync gTLD data via npm run sync. It will fetch, parse, and overwrite the gtlds.json file.

Last updated: February 12, 2026
Total gTLDs: 1,275 (1,120 active, 155 terminated)

The list includes 4 new gTLDs since the previous version: .hotel, .kids, .merck, and .music.

License

MIT © Chris Vogt