Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
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.
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
The 'psl' package, also known as 'public suffix list', is a Node.js module that allows you to work with the public suffix list from Mozilla. It provides functionalities to parse domain names and extract the TLD, which is similar to what 'tlds' offers. However, 'psl' also includes additional features such as finding the domain root and checking if a domain is a public suffix.
List of TLDs, scraped from ICANN
(The MIT License)
Copyright (c) 2013 Stephen Mathieson <me@stephenmathieson.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1.0.2 / 2014-09-10
FAQs
A list of TLDs.
The npm package tlds receives a total of 1,155,042 weekly downloads. As such, tlds popularity was classified as popular.
We found that tlds demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
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.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.