ip-net

1.0.1 • Public • Published

ip-tools

some useful functions to IP(IPv4 and IPv6)

Usage

// IP Object
const ip = ipv4('192.168.0.1')
ip.address // 192.168.0.1
ip.isValid() // true
ip.inReversedRange() // number
ip.getOctet(2)
ip.getOctets()
ip.containBy(network)

// Subnet Object
const subnet = subnetv4('192.168.1.1/24')
subnet.networkAddress // 192.168.1.0
subnet.broadcastAddress // 192.168.1.255
subnet.firstHost // 192.168.1.1
subnet.lastHost // 192.168.1.254
subnet.mask // 255.255.255.0
subnet.cidrMask // 24

Readme

Keywords

Package Sidebar

Install

npm i ip-net

Weekly Downloads

13

Version

1.0.1

License

MIT

Unpacked Size

46.9 kB

Total Files

38

Last publish

Collaborators

  • __murphy