ipop
IP subnet calculator. One can also use it to check if IP is in subnet.
Install
npm install ipop
Usage
Example
var ipop = ; // check if IP in subnetconsole;console;console; // show subnet infoconsole;
Output:
falsetruetrue net: '87.239.88.0' netmask: '255.255.252.0' broadcast: '87.239.91.255' low: '87.239.88.1' high: '87.239.91.254' hosts: 1022
Documentation
ip4incidr(ip, cidr)
check
if ip
is in given cidr
. Returns boolean
. cidr
has to be in format X.X.X.X/X
.
cidr4(cidr)
cidr4
returns object with info about given cidr
:
net
: network addressnetmask
: network maskbroadcast
: broadcast addresslow
: first usable host addresshigh
: last usable host addresshosts
: number of usable hosts