@@ -224,6 +224,10 @@ always `[0, 0, 0]`.
224224
225225<!-- YAML
226226added: 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.
227231-->
228232
229233* Returns: {Object}
@@ -238,12 +242,12 @@ The properties available on the assigned network address object include:
238242
239243* ` address ` {string} The assigned IPv4 or IPv6 address
240244* ` 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)
242246* ` mac ` {string} The MAC address of the network interface
243247* ` internal ` {boolean} ` true ` if the network interface is a loopback or
244248 similar interface that is not remotely accessible; otherwise ` false `
245249* ` scopeid ` {number} The numeric IPv6 scope ID (only specified when ` family `
246- is ` IPv6 ` )
250+ is ` 6 ` )
247251* ` cidr ` {string} The assigned IPv4 or IPv6 address with the routing prefix
248252 in CIDR notation. If the ` netmask ` is invalid, this property is set
249253 to ` null ` .
@@ -256,15 +260,15 @@ The properties available on the assigned network address object include:
256260 {
257261 address: ' 127.0.0.1' ,
258262 netmask: ' 255.0.0.0' ,
259- family: ' IPv4 ' ,
263+ family: 4 ,
260264 mac: ' 00:00:00:00:00:00' ,
261265 internal: true ,
262266 cidr: ' 127.0.0.1/8'
263267 },
264268 {
265269 address: ' ::1' ,
266270 netmask: ' ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' ,
267- family: ' IPv6 ' ,
271+ family: 6 ,
268272 mac: ' 00:00:00:00:00:00' ,
269273 scopeid: 0 ,
270274 internal: true ,
@@ -275,15 +279,15 @@ The properties available on the assigned network address object include:
275279 {
276280 address: ' 192.168.1.108' ,
277281 netmask: ' 255.255.255.0' ,
278- family: ' IPv4 ' ,
282+ family: 4 ,
279283 mac: ' 01:02:03:0a:0b:0c' ,
280284 internal: false ,
281285 cidr: ' 192.168.1.108/24'
282286 },
283287 {
284288 address: ' fe80::a00:27ff:fe4e:66a1' ,
285289 netmask: ' ffff:ffff:ffff:ffff::' ,
286- family: ' IPv6 ' ,
290+ family: 6 ,
287291 mac: ' 01:02:03:0a:0b:0c' ,
288292 scopeid: 1 ,
289293 internal: false ,
0 commit comments