BaseAddress returns the base address for a given subnet address
Source code: <>
baseAddress( ) ⇒ null | string
<>
▪ networkAddress string
- A network address like 192.168.0.4/24
▫ throwErrors? undefined | true | false
- Stop the library from failing silently
BroadcastAddress returns the broadcast address for an IPv4 address.
Please note that IPv6 does not have broadcast addresses.
Source code: <>
broadcastAddress( ) ⇒ null | string
<>
▪ network string
- A network like 192.168.0.0/24
▫ throwErrors? undefined | true | false
- Stop the library from failing silently
FindUnusedSubnets returns array of unused subnets given the aggregate and sibling subnets
Source code: <>
findUnusedSubnets( ) ⇒ null | string[]
<>
▪ aggregate string
- An aggregate network like 192.168.0.0/24
▪ subnets string[]
- Array of subnetworks like ["192.168.0.0/24", "192.168.0.128/26"]
▫ strict? undefined | true | false
- Do not automatically mask addresses to baseAddresses
▫ throwErrors? undefined | true | false
- Stop the library from failing silently
Function ip
Parse an IP address
Source code: <>
ip( ) ⇒ null | string
<>
▪ address string
- Either an address like 192.168.0.0 or subnet 192.168.0.0/24
▫ throwErrors? undefined | true | false
- Stop the library from failing silently
Parse a network address
Source code: <>
network( ) ⇒ null | string
<>
▪ networkAddress string
- A network like 192.168.0.0/24
▫ throwErrors? undefined | true | false
- Stop the library from failing silently
NetworkComesBefore returns a bool with regards to numerical network order.
Please note that IPv4 comes before IPv6 and larger networks come before smaller ones.
Source code: <>
networkComesBefore( ) ⇒ null | true | false
<>
▪ network string
- A network like 192.168.0.0/24
▪ otherNetwork string
- A network like 192.168.1.0/24
▫ strict? undefined | true | false
- Do not automatically mask addresses to baseAddresses
▫ throwErrors? undefined | true | false
- Stop the library from failing silently
NetworkContainsAddress validates that the address is inside the network
Source code: <>
networkContainsAddress( ) ⇒ null | true | false
<>
▪ network string
- A network like 192.168.0.0/24
▪ address string
- A network like 192.168.0.100
▫ strict? undefined | true | false
- Do not automatically mask addresses to baseAddresses
▫ throwErrors? undefined | true | false
- Stop the library from failing silently
NetworkContainsSubnet validates that the network is a valid supernet
Source code: <>
networkContainsSubnet( ) ⇒ null | true | false
<>
▪ network string
- A network like 192.168.0.0/16
▪ subnet string
- A network like 192.168.0.0/24
▫ strict? undefined | true | false
- Do not automatically mask addresses to baseAddresses
▫ throwErrors? undefined | true | false
- Stop the library from failing silently
NetworksIntersect returns a bool showing if the networks overlap
Source code: <>
networksIntersect( ) ⇒ null | true | false
<>
▪ network string
- A network like 192.168.0.0/23
▪ otherNetwork string
- A network like 192.168.1.0/24
▫ strict? undefined | true | false
- Do not automatically mask addresses to baseAddresses
▫ throwErrors? undefined | true | false
- Stop the library from failing silently
NextAddress returns the next address
Source code: <>
nextAddress( ) ⇒ null | string
<>
▪ address string
- An address like 192.168.0.0
▫ throwErrors? undefined | true | false
- Stop the library from failing silently
NextNetwork returns the next network of the same size.
Source code: <>
nextNetwork( ) ⇒ null | string
<>
▪ network string
- A network like 192.168.0.0/24
▫ strict? undefined | true | false
- Do not automatically mask addresses to baseAddresses
▫ throwErrors? undefined | true | false
- Stop the library from failing silently
RangeOfNetworks returns an array of networks given a range of addresses
Source code: <>
rangeOfNetworks( ) ⇒ null | string[]
<>
▪ startAddress string
- An address like 192.168.1.2
▪ stopAddress string
- An address like 192.168.1.5
▫ throwErrors? undefined | true | false
- Stop the library from failing silently
Function sort
Sort returns an array of sorted networks
Source code: <>
sort( ) ⇒ null | string[]
<>
▪ networkAddresses string[]
- An array of addresses or subnets
▫ throwErrors? undefined | true | false
- Stop the library from failing silently
Summarize returns an array of aggregates given a list of networks
Source code: <>
summarize( ) ⇒ null | string[]
<>
▪ networks string[]
- An array of addresses or subnets
▫ strict? undefined | true | false
- Do not automatically mask addresses to baseAddresses
▫ throwErrors? undefined | true | false
- Stop the library from failing silently