Create a new Subnet
import { network } from "@rjweb/utils"
const subnet = new network.Subnet('127.0.0.1/24')
subnet.isIPv4() // true
subnet.size() // 255n
subnet.first() // <IPAddress v4 127.0.0.0>
subnet.last() // <IPAddress v4 127.0.0.255>
for (const ip of subnet) {
console.log(ip.long())
}
1.7.0
nodejs, browser
Private
iThe Net Mask of the Subnet
1.11.0
The Subnet Mask of the Subnet
1.11.4
Private
typeProtected
[inspectProtected
to
A Respresentation of a Subnet
Example
Since
1.7.0
Supports
nodejs, browser