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 - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

index.d.ts

8

index.js
'use strict';
const ipRegex = require('ip-regex');
const isIp = module.exports = x => ipRegex({exact: true}).test(x);
isIp.v4 = x => ipRegex.v4({exact: true}).test(x);
isIp.v6 = x => ipRegex.v6({exact: true}).test(x);
const isIp = string => ipRegex({exact: true}).test(string);
isIp.v4 = string => ipRegex.v4({exact: true}).test(string);
isIp.v6 = string => ipRegex.v6({exact: true}).test(string);
module.exports = isIp;
{
"name": "is-ip",
"version": "2.0.0",
"description": "Check if a string is an IP address",
"license": "MIT",
"repository": "sindresorhus/is-ip",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"ip",
"ipv6",
"ipv4",
"regex",
"regexp",
"re",
"match",
"test",
"find",
"text",
"pattern",
"internet",
"protocol",
"address",
"validate",
"detect",
"check",
"is",
"string"
],
"dependencies": {
"ip-regex": "^2.0.0"
},
"devDependencies": {
"ava": "*",
"xo": "*"
},
"xo": {
"esnext": true
}
"name": "is-ip",
"version": "3.0.0",
"description": "Check if a string is an IP address",
"license": "MIT",
"repository": "sindresorhus/is-ip",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"ip",
"ipv6",
"ipv4",
"regex",
"regexp",
"match",
"test",
"find",
"text",
"pattern",
"internet",
"protocol",
"address",
"validate",
"detect",
"check",
"is",
"string"
],
"dependencies": {
"ip-regex": "^4.0.0"
},
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}

@@ -9,3 +9,3 @@ # is-ip [![Build Status](https://travis-ci.org/sindresorhus/is-ip.svg?branch=master)](https://travis-ci.org/sindresorhus/is-ip)

```
$ npm install --save is-ip
$ npm install is-ip
```

@@ -32,13 +32,13 @@

### isIp(input)
### isIp(string)
Check if `input` is IPv4 or IPv6.
Check if `string` is IPv4 or IPv6.
### isIp.v4(input)
### isIp.v4(string)
Check if `input` is IPv4.
Check if `string` is IPv4.
### isIp.v6(input)
### isIp.v6(string)
Check if `input` is IPv6.
Check if `string` is IPv6.

@@ -49,2 +49,4 @@

- [ip-regex](https://github.com/sindresorhus/ip-regex) - Regular expression for matching IP addresses
- [is-cidr](https://github.com/silverwind/is-cidr) - Check if a string is an IP address in CIDR notation
- [cidr-regex](https://github.com/silverwind/cidr-regex) - Regular expression for matching IP addresses in CIDR notation

@@ -51,0 +53,0 @@

Sorry, the diff of this file is not supported yet

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