ifconfig-linux
Wrap ifconfig and parse result to json format (work on linux, not work on mac).
Command-line Example
root@ubuntu-2gb-sfo1-01:~# ifconfig-linuxeth0:device: 'eth0'link: encap: 'Ethernet' hwaddr: '04:01:d3:db:fd:01'inet:addr: '107.170.222.198'bcast: '107.170.223.255'mask: '255.255.240.0'inet6: addr: 'fe80::601:d3ff:fedb:fd01/64' scope: 'Link'other:collisions: 0txqueuelen: 1000rxBytes: 17278968txBytes: 19145675rx: packets: 71118 errors: 0 dropped: 0 overruns: 0 frame: 0tx: packets: 69479 errors: 0 dropped: 0 overruns: 0 carrier: 0lo:device: 'lo'link: encap: 'Local'inet: addr: '127.0.0.1' mask: '255.0.0.0'inet6: addr: '::1/128' scope: 'Host'other:collisions: 0txqueuelen: 0rxBytes: 30545056txBytes: 30545056rx: packets: 170494 errors: 0 dropped: 0 overruns: 0 frame: 0tx: packets: 170494 errors: 0 dropped: 0 overruns: 0 carrier: 0
API Example
In addition to ifconfig-linux shell command-line, you can also require('ifconfig-linux')
from your node.js application as you wish.
var promise = ; // this return a promisepromise;
How it works
This module is based on ifconfig
linux command. It's tested and works on Ubuntu 14.04.4
install
With npm do:
npm install ifconfig-linux -g
license
MIT