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

is-my-ip-valid

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-my-ip-valid

A small lib to validate IP addresses.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
897K
decreased by-26.27%
Maintainers
1
Weekly downloads
 
Created

What is is-my-ip-valid?

The is-my-ip-valid npm package is a utility for validating IP addresses. It supports both IPv4 and IPv6 formats and provides simple methods to check if an IP address is valid.

What are is-my-ip-valid's main functionalities?

Validate IPv4

This feature allows you to validate if a given string is a valid IPv4 address.

const isMyIpValid = require('is-my-ip-valid');

const ipv4 = '192.168.1.1';
const isValidIPv4 = isMyIpValid(ipv4);
console.log(`Is ${ipv4} a valid IPv4 address?`, isValidIPv4);

Validate IPv6

This feature allows you to validate if a given string is a valid IPv6 address.

const isMyIpValid = require('is-my-ip-valid');

const ipv6 = '2001:0db8:85a3:0000:0000:8a2e:0370:7334';
const isValidIPv6 = isMyIpValid(ipv6);
console.log(`Is ${ipv6} a valid IPv6 address?`, isValidIPv6);

Custom Validation

This feature allows you to create a custom validator for specific IP address formats, such as IPv4 with CIDR notation.

const isMyIpValid = require('is-my-ip-valid');

const customValidator = isMyIpValid({ version: 4, cidr: true });
const ip = '192.168.1.1/24';
const isValid = customValidator(ip);
console.log(`Is ${ip} a valid IPv4 CIDR address?`, isValid);

Other packages similar to is-my-ip-valid

FAQs

Package last updated on 01 Mar 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