Socket
Socket
Sign inDemoInstall

tlds

Package Overview
Dependencies
0
Maintainers
4
Versions
251
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tlds

A list of TLDs.


Version published
Weekly downloads
1.2M
decreased by-19%
Maintainers
4
Install size
18.3 kB
Created
Weekly downloads
 

Package description

What is tlds?

The tlds npm package provides a list of top-level domains (TLDs) as recognized by the Internet Assigned Numbers Authority (IANA). This package can be used to validate domain names, parse URLs, and perform operations that require knowledge of valid TLDs.

What are tlds's main functionalities?

Get the full list of TLDs

This feature allows you to retrieve the full list of TLDs. You can use this list to check if a domain's TLD is valid or to enumerate all possible TLDs.

const tlds = require('tlds');
console.log(tlds); // Outputs the array of TLDs

Check if a TLD exists

This feature allows you to check if a specific TLD exists in the list of valid TLDs. This can be useful for validating domain names or filtering user input.

const tlds = require('tlds');
const isTldValid = tlds.includes('com');
console.log(isTldValid); // Outputs true

Other packages similar to tlds

Readme

Source

tlds

List of TLDs from ICANN.

Install

npm install tlds

Usage

const tlds = require("tlds");

console.log(tlds);
//=> ['aaa', 'aarp', 'abarth', 'abb', 'abbott', 'abbvie', 'abc', ...]

Keywords

FAQs

Last updated on 28 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc