node-local-ip
Get local ip address in node.
Installation
npm install local-ip
Why?
Well, for different kinds of reasons you might want to know what your local ip address is so you can broadcast it to different services.
API
localip(interface, [callback])
interface should be a network interface, such as wlan0.
callback is optional, and will be invoked with the signature callback(err, res)
if specified. If no callback is specified, the value will be returned directly, or an Error will be thrown in case of an error.
Example
var localip = ;var iface = 'wlan0'; ;
You can also use it in sync mode:
var iface = 'wlan0';var localip = interface;console;
License
MIT