Socket
Socket
Sign inDemoInstall

is-ip

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-ip

Check if a string is an IP address


Version published
Maintainers
1
Created

What is is-ip?

The is-ip npm package is a utility library for checking if a given string is a valid IP address. It supports both IPv4 and IPv6 addresses and provides simple, easy-to-use functions for validation.

What are is-ip's main functionalities?

Check if a string is a valid IP address

This feature allows you to check if a given string is a valid IP address, whether it's IPv4 or IPv6.

const isIp = require('is-ip');

console.log(isIp('192.168.0.1')); // true
console.log(isIp('::1')); // true
console.log(isIp('invalid-ip')); // false

Check if a string is a valid IPv4 address

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

const isIp = require('is-ip');

console.log(isIp.v4('192.168.0.1')); // true
console.log(isIp.v4('::1')); // false

Check if a string is a valid IPv6 address

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

const isIp = require('is-ip');

console.log(isIp.v6('::1')); // true
console.log(isIp.v6('192.168.0.1')); // false

Other packages similar to is-ip

Keywords

FAQs

Package last updated on 17 Apr 2019

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