@@ -224,6 +224,10 @@ always `[0, 0, 0]`.
224
224
225
225
<!-- YAML
226
226
added: v0.6.0
227
+ changes:
228
+ - version: v18.0.0
229
+ pr-url: https://github.com/nodejs/node/pull/41431
230
+ description: The `family` property now returns a number instead of a string.
227
231
-->
228
232
229
233
* Returns: {Object}
@@ -238,12 +242,12 @@ The properties available on the assigned network address object include:
238
242
239
243
* ` address ` {string} The assigned IPv4 or IPv6 address
240
244
* ` netmask ` {string} The IPv4 or IPv6 network mask
241
- * ` family ` {string } Either ` IPv4 ` or ` IPv6 `
245
+ * ` family ` {number } Either ` 4 ` (for IPv4) or ` 6 ` (for IPv6)
242
246
* ` mac ` {string} The MAC address of the network interface
243
247
* ` internal ` {boolean} ` true ` if the network interface is a loopback or
244
248
similar interface that is not remotely accessible; otherwise ` false `
245
249
* ` scopeid ` {number} The numeric IPv6 scope ID (only specified when ` family `
246
- is ` IPv6 ` )
250
+ is ` 6 ` )
247
251
* ` cidr ` {string} The assigned IPv4 or IPv6 address with the routing prefix
248
252
in CIDR notation. If the ` netmask ` is invalid, this property is set
249
253
to ` null ` .
@@ -256,15 +260,15 @@ The properties available on the assigned network address object include:
256
260
{
257
261
address: ' 127.0.0.1' ,
258
262
netmask: ' 255.0.0.0' ,
259
- family: ' IPv4 ' ,
263
+ family: 4 ,
260
264
mac: ' 00:00:00:00:00:00' ,
261
265
internal: true ,
262
266
cidr: ' 127.0.0.1/8'
263
267
},
264
268
{
265
269
address: ' ::1' ,
266
270
netmask: ' ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' ,
267
- family: ' IPv6 ' ,
271
+ family: 6 ,
268
272
mac: ' 00:00:00:00:00:00' ,
269
273
scopeid: 0 ,
270
274
internal: true ,
@@ -275,15 +279,15 @@ The properties available on the assigned network address object include:
275
279
{
276
280
address: ' 192.168.1.108' ,
277
281
netmask: ' 255.255.255.0' ,
278
- family: ' IPv4 ' ,
282
+ family: 4 ,
279
283
mac: ' 01:02:03:0a:0b:0c' ,
280
284
internal: false ,
281
285
cidr: ' 192.168.1.108/24'
282
286
},
283
287
{
284
288
address: ' fe80::a00:27ff:fe4e:66a1' ,
285
289
netmask: ' ffff:ffff:ffff:ffff::' ,
286
- family: ' IPv6 ' ,
290
+ family: 6 ,
287
291
mac: ' 01:02:03:0a:0b:0c' ,
288
292
scopeid: 1 ,
289
293
internal: false ,
0 commit comments