node-localip

v0.1.2
Simple tool that gives you the local, prefered (default/active) IPv4 addresse.

node-localip

Simple tool that gives you the local, prefered (default/active) IPv4 addresses.

Install

As a command line tool

$ (sudo) npm install node-localip -g

As a node module:

$ npm install node-localip

Usage

Command line:

$ localip
10.58.100.191
$

Node module:

var getLocalIp = require( "node-localip" );

getLocalIp( function ( err, ip ) {
    console.log( err || ip );
} );

... or, list all local IPv4 addresses with the prefered as the first ...

getLocalIp.list( function ( err, ipList ) {
    console.log( err || ipList );
} );

License

MIT

Metadata

  • MIT
  • Whatever
  • starak
  • released 4/21/2015

Downloads

Maintainers