is-my-ip-valid

WebJar for is-my-ip-valid

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

is-my-ip-valid
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

is-my-ip-valid
WebJar for is-my-ip-valid
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/LinusU/is-my-ip-valid

Download is-my-ip-valid

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/is-my-ip-valid/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>is-my-ip-valid</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/is-my-ip-valid/
implementation 'org.webjars.npm:is-my-ip-valid:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/is-my-ip-valid/
implementation ("org.webjars.npm:is-my-ip-valid:1.0.0")
'org.webjars.npm:is-my-ip-valid:jar:1.0.0'
<dependency org="org.webjars.npm" name="is-my-ip-valid" rev="1.0.0">
  <artifact name="is-my-ip-valid" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='is-my-ip-valid', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "is-my-ip-valid" % "1.0.0"
[org.webjars.npm/is-my-ip-valid "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Is my IP valid

A small lib to validate IP addresses.

Installation

npm install --save is-my-ip-valid

Usage

const validator = require('is-my-ip-valid')
const validate = validator()
const validate4 = validator({ version: 4 })
const validate6 = validator({ version: 6 })

console.log(validate('127.0.0.1'))
//=> true

console.log(validate4('127.0.0.1'))
//=> true

console.log(validate6('127.0.0.1'))
//=> false

console.log(validate('2001:0db8:85a3:0000:0000:8a2e:0370:7334'))
//=> true

console.log(validate4('2001:0db8:85a3:0000:0000:8a2e:0370:7334'))
//=> false

console.log(validate6('2001:0db8:85a3:0000:0000:8a2e:0370:7334'))
//=> true

Acknowledgements

The code is mostly based on this wonderful library: beaugunderson/ip-address

All regexes used are audited for catastrophic backtracking by this module: substack/safe-regex

Versions

Version
1.0.0