Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-valid-domain

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-valid-domain

Validate domain name

  • 0.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
487K
decreased by-19.6%
Maintainers
1
Weekly downloads
 
Created

What is is-valid-domain?

The is-valid-domain npm package is used to validate domain names. It checks if a given string is a valid domain name according to the rules specified in various domain name standards.

What are is-valid-domain's main functionalities?

Basic Domain Validation

This feature allows you to check if a given string is a valid domain name. The function returns true if the domain is valid and false otherwise.

const isValidDomain = require('is-valid-domain');

console.log(isValidDomain('example.com')); // true
console.log(isValidDomain('invalid_domain')); // false

Subdomain Validation

This feature allows you to validate subdomains. It ensures that subdomains follow the correct format and rules.

const isValidDomain = require('is-valid-domain');

console.log(isValidDomain('sub.example.com')); // true
console.log(isValidDomain('sub..example.com')); // false

Top-Level Domain (TLD) Validation

This feature checks if the domain has a valid top-level domain (TLD). It ensures that the TLD is recognized and valid.

const isValidDomain = require('is-valid-domain');

console.log(isValidDomain('example.xyz')); // true
console.log(isValidDomain('example.invalidtld')); // false

Other packages similar to is-valid-domain

Keywords

FAQs

Package last updated on 22 Feb 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc