get the private network ip address of the machine
Get the IPv4 addresses of all network interfaces on a machine
npm install -S interface-addresses
Require the module and call it with no arguments. The returned
addresses value will be an object where the key is the name of the interface and the value is the ip address
var inspect = require'eyespect'inspectorvar interfaceAddresses = require'interface-addresses'var addresses = interfaceAddressesinspectaddresses 'network interface IPv4 addresses (non-internal only)'
In the example above, addresses is an object that looks like the following
en1: '192.168.1.101'vnic0: '10.211.55.2'vnic1: '10.37.129.2'vboxnet0: '18.104.22.168'
You will need to install the
eyespect module to run the example code above, which you can do using
npm install -S eyespect
# install the development dependenciesnpm install# run the testsnpm test