0.1.3 • Published 9 years ago

node-localip v0.1.3

Weekly downloads
385
License
MIT
Repository
-
Last release
9 years ago

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