0.0.3 • Published 10 years ago

interfaces v0.0.3

Weekly downloads
17
License
MIT
Repository
github
Last release
10 years ago

Hm?

Build Status

This plugin will hold me over until v0.12 is released and stable -- and adds needed functionality for those can't or wont update

  • Produces output similar to os.networkInterfaces(), but with an added MAC address per interface
  • os.networkInterfaces() was changed in master and will be first released in v0.12 to include this functionality See #6686
  • lib/utils.js also includes a synchronous execute that has been added master and will be released in v0.12 See Changeset
  • I've tried to keep the output and usage as close as I can to what is in master -- so you should /knockonwood/ just be able to switch your call when you update

Tested On

OSNode
OS X 10.9.20.10.26
Ubuntu 12.04 LTS0.10.26
Win 7 Ent. Sp10.10.26

Usage

var interfaces = require('interfaces');

console.log(interfaces());
$ node test.js             
{ lo0: 
   [ { address: '::1',
       family: 'IPv6',
       internal: true,
       mac: '00:00:00:00:00:00' },
     { address: '127.0.0.1',
       family: 'IPv4',
       internal: true,
       mac: '00:00:00:00:00:00' },
     { address: 'fe80::1',
       family: 'IPv6',
       internal: true,
       mac: '00:00:00:00:00:00' } ],
  en0: 
   [ { address: 'fe80::baf6:b1ff:fe1c:2e07',
       family: 'IPv6',
       internal: false,
       mac: 'b8:f6:b1:1c:2e:07' },
     { address: '10.0.1.7',
       family: 'IPv4',
       internal: false,
       mac: 'b8:f6:b1:1c:2e:07' } ] }