When I run console.log(os.networkInterfaces());, I get the output shown below.
How do I access family under Ethernet 4 in Javascript?
I tried this:
console.log(os.networkInterfaces().Ethernet 4[0].family); 
but it doesn't work.
OUTPUT for console.log(os.networkInterfaces());
{ 'Ethernet 4':
   [ { address: '9.0.0.1',
       netmask: '255.255.255.0',
       family: 'IPv4',
       mac: '00:ff:8c:22:df:9d',
       internal: false,
       cidr: '9.0.0.1/24' } ],
  'Wi-Fi':
   [ { address: 'fe80::2160:bed0:15d8:6a4c',
       netmask: 'ffff:ffff:ffff:ffff::',
       family: 'IPv6',
       mac: 'f0:03:8c:9c:71:a1',
       scopeid: 10,
       internal: false,
       cidr: 'fe80::2160:bed0:15d8:6a4c/64' },
     { address: '192.168.0.3',
       netmask: '255.255.255.0',
       family: 'IPv4',
       mac: 'f0:03:8c:9c:71:a1',
       internal: false,
       cidr: '192.168.0.3/24' } ],
  'Loopback Pseudo-Interface 1':
   [ { address: '::1',
       netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
       family: 'IPv6',
       mac: '00:00:00:00:00:00',
       scopeid: 0,
       internal: true,
       cidr: '::1/128' },
     { address: '127.0.0.1',
       netmask: '255.0.0.0',
       family: 'IPv4',
       mac: '00:00:00:00:00:00',
       internal: true,
       cidr: '127.0.0.1/8' } ] }
 
     
     
    