node-localip

0.1.3 • Public • Published

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

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i node-localip

    Weekly Downloads

    973

    Version

    0.1.3

    License

    MIT

    Last publish

    Collaborators

    • starak
    • skarbo