ip-validator

Super simple IP Address validator for ipv4 & ipv6

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
ip-validator
200.0.19 years ago9 years agoMinified + gzip package size for ip-validator in KB

Readme

ip-validator
Super simple IP Address validator for ipv4 & ipv6
var validate = require('ip-validator');

var ipv4 = "212.212.100.110"
var ipv6 = "0000:0000:0000:0000:0000:0000:0000:0001"

validate.ipv4(ipv4); // true
validate.ipv4(ipv6); // false

validate.ipv6(ipv4); // false
validate.ipv6(ipv6); // true

validate.ip(ipv4); // true
validate.ip(ipv6); // true