node-cidr is a Javascript library that makes it easy to manipulate IPs and Subnets. Currently only IPv4 is supported, but IPv6 support is planned for a future release.
- address
- broadcast
- cidrCommonCidr
- count
- includes
- intCommonCidr
- ipCommonCidr
- ips
- mask
- max
- min
- netmask
- next
- nextCidr
- padLeft
- previous
- previousCidr
- random
- reverse
- subnets
- toBinary
- toCidr
- toHex
- toInt
- toIntRange
- toOctets
- toRange
- toString
- usable
- validateCidr
- validateIp
- wildcardmask
● invalidChars: RegExp
= /^.?(?=[^#%&$*:<>?/{|}[a-zA-Z]).$/
Defined in index.ts:3
► address(ip: string
): string
Defined in index.ts:155
Parameters:
Param | Type | Description |
---|---|---|
ip | string |
- |
Returns: string
► broadcast(cidr: string
): string
Defined in index.ts:175
Parameters:
Param | Type | Description |
---|---|---|
cidr | string |
- |
Returns: string
► cidrCommonCidr(cidrs: string
[]): string
Defined in index.ts:166
Parameters:
Param | Type | Description |
---|---|---|
cidrs | string [] |
- |
Returns: string
► count(cidr: string
): number
Defined in index.ts:190
Parameters:
Param | Type | Description |
---|---|---|
cidr | string |
- |
Returns: number
► includes(cidr: string
, ip: string
): boolean
Defined in index.ts:240
Parameters:
Param | Type | Description |
---|---|---|
cidr | string |
- |
ip | string |
- |
Returns: boolean
► intCommonCidr(ips: number
[]): string
Defined in index.ts:5
Parameters:
Param | Type | Description |
---|---|---|
ips | number [] |
- |
Returns: string
► ipCommonCidr(ips: string
[]): string
Defined in index.ts:57
Parameters:
Param | Type | Description |
---|---|---|
ips | string [] |
- |
Returns: string
► ips(cidr: string
): string
[]
Defined in index.ts:229
Parameters:
Param | Type | Description |
---|---|---|
cidr | string |
- |
Returns: string
[]
► mask(ip: string
): number
Defined in index.ts:157
Parameters:
Param | Type | Description |
---|---|---|
ip | string |
- |
Returns: number
► max(cidr: string
): string
Defined in index.ts:184
Parameters:
Param | Type | Description |
---|---|---|
cidr | string |
- |
Returns: string
► min(cidr: string
): string
Defined in index.ts:177
Parameters:
Param | Type | Description |
---|---|---|
cidr | string |
- |
Returns: string
► netmask(cidr: string
): string
Defined in index.ts:172
Parameters:
Param | Type | Description |
---|---|---|
cidr | string |
- |
Returns: string
► next(ip: string
): string
Defined in index.ts:111
Returns the next adjacent address.
Parameters:
Param | Type | Description |
---|---|---|
ip | string |
- |
Returns: string
► nextCidr(cidr: string
): string
Defined in index.ts:245
Parameters:
Param | Type | Description |
---|---|---|
cidr | string |
- |
Returns: string
► padLeft(input: string
, char: string
, min: number
): string
Defined in index.ts:26
Parameters:
Param | Type | Description |
---|---|---|
input | string |
- |
char | string |
- |
min | number |
- |
Returns: string
► previous(ip: string
): string
Defined in index.ts:117
Returns the previous adjacent address.
Parameters:
Param | Type | Description |
---|---|---|
ip | string |
- |
Returns: string
► previousCidr(cidr: string
): string
Defined in index.ts:248
Parameters:
Param | Type | Description |
---|---|---|
cidr | string |
- |
Returns: string
► random(cidr: string
): string
Defined in index.ts:251
Parameters:
Param | Type | Description |
---|---|---|
cidr | string |
- |
Returns: string
► reverse(ip: string
⎮number
): string
Defined in index.ts:73
Returns the reverse lookup hostname for the address.
Parameters:
Param | Type | Description |
---|---|---|
ip | string ⎮number |
- |
Returns: string
► subnets(cidr: string
, subMask: number
, limit: number
): string
[]
Defined in index.ts:206
Parameters:
Param | Type | Description |
---|---|---|
cidr | string |
- |
subMask | number |
- |
limit | number |
- |
Returns: string
[]
► toBinary(ip: string
⎮number
): string
Defined in index.ts:84
Returns the binary representation of the address, in string form.
Parameters:
Param | Type | Description |
---|---|---|
ip | string ⎮number |
- |
Returns: string
► toCidr(ip: string
⎮number
): string
Defined in index.ts:119
Parameters:
Param | Type | Description |
---|---|---|
ip | string ⎮number |
- |
Returns: string
► toHex(ip: string
⎮number
): string
Defined in index.ts:97
Provides the hex value of the address.
Parameters:
Param | Type | Description |
---|---|---|
ip | string ⎮number |
- |
Returns: string
► toInt(ipAddress: string
): number
Defined in index.ts:35
Parameters:
Param | Type | Description |
---|---|---|
ipAddress | string |
- |
Returns: number
► toIntRange(cidr: string
): number
[]
Defined in index.ts:159
Parameters:
Param | Type | Description |
---|---|---|
cidr | string |
- |
Returns: number
[]
► toOctets(input: string
⎮number
): number
[]
Defined in index.ts:62
Parameters:
Param | Type | Description |
---|---|---|
input | string ⎮number |
- |
Returns: number
[]
► toRange(cidr: string
): string
[]
Defined in index.ts:164
Parameters:
Param | Type | Description |
---|---|---|
cidr | string |
- |
Returns: string
[]
► toString(ipInt: number
): string
Defined in index.ts:43
Parameters:
Param | Type | Description |
---|---|---|
ipInt | number |
- |
Returns: string
► usable(cidr: string
): string
[]
Defined in index.ts:192
Parameters:
Param | Type | Description |
---|---|---|
cidr | string |
- |
Returns: string
[]
► validateCidr(cidr: string
): string
⎮null
Defined in index.ts:256
Parameters:
Param | Type | Description |
---|---|---|
cidr | string |
- |
Returns: string
⎮null
► validateIp(ip: string
): string
⎮null
Defined in index.ts:126
Parameters:
Param | Type | Description |
---|---|---|
ip | string |
- |
Returns: string
⎮null
► wildcardmask(cidr: string
): string
Defined in index.ts:203
Parameters:
Param | Type | Description |
---|---|---|
cidr | string |
- |
Returns: string
● address: address
Defined in index.ts:287
● broadcast: broadcast
Defined in index.ts:280
● commonCidr: cidrCommonCidr = cidrCommonCidr
Defined in index.ts:274
● count: count
Defined in index.ts:277
● includes: includes
Defined in index.ts:283
● ips: ips
Defined in index.ts:282
● mask: mask
Defined in index.ts:288
● max: max
Defined in index.ts:275
● min: min
Defined in index.ts:276
● netmask: netmask
Defined in index.ts:278
● next: nextCidr = nextCidr
Defined in index.ts:285
● previous: previousCidr = previousCidr
Defined in index.ts:286
● random: random
Defined in index.ts:284
● subnets: subnets
Defined in index.ts:281
● toIntRange: toIntRange
Defined in index.ts:273
● toRange: toRange
Defined in index.ts:271
● usable: usable
Defined in index.ts:272
● validate: validateCidr = validateCidr
Defined in index.ts:289
● wildcardmask: wildcardmask
Defined in index.ts:279
● commonCidr: ipCommonCidr = ipCommonCidr
Defined in index.ts:142
● next: next
Defined in index.ts:148
● previous: previous
Defined in index.ts:147
● reverse: reverse
Defined in index.ts:146
● toBinary: toBinary
Defined in index.ts:145
● toCidr: toCidr
Defined in index.ts:149
● toHex: toHex
Defined in index.ts:143
● toInt: toInt
Defined in index.ts:140
● toOctets: toOctets
Defined in index.ts:144
● toString: toString
Defined in index.ts:141
● validate: validateIp = validateIp
Defined in index.ts:150