Enter your search

New Open Source Module: IPCheck

By
Quickly validate and check IPs & CIDR blocks

We’ve just released another open-source Node.js module! IPCheck adds an efficient layer on top of ipaddr.js to make it more efficient and seamlessly handle IPv4 and IPv6 addresses.

When passed an IP address and a CIDR block, IPCheck will quickly check whether the IP is in that range.

Check out IPCheck on GitHub or npm.

Detailed usage examples are documented in the README, but here are a few quick examples…

var IPCheck = require('ipcheck');
IPCheck.match('192.168.0.1', '192.168.0.1/32'); //= true 

var ip = new IPCheck('FE80:0000:0000:0000:0202:B3FF:FE1E:8329');
var cidr = new IPCheck('FE80:0000:0000:0000:0202:B3FF:FE1E:8329/128');
ip.match(cidr); //= true
ip.match('invalid ip'); //= false

var invalid = new IPCheck(null);
invalid.valid; //= false

Enjoy!

Written by
Lead developer at GoSquared for integrations, partnerships and the API. Works on pretty much everything.

You May Also Like

Group 5 Created with Sketch. Group 11 Created with Sketch. CLOSE ICON Created with Sketch. icon-microphone Group 9 Created with Sketch. CLOSE ICON Created with Sketch. SEARCH ICON Created with Sketch. Group 4 Created with Sketch. Path Created with Sketch. Group 5 Created with Sketch.