Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

local-ip

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

local-ip

Get local ip address in node.

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
196
-34.23%
Maintainers
1
Weekly downloads
 
Created
Source

node-local-ip

Build Status Code Climate

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.

Example

var localip = require('local-ip');
var interface = 'wlan0';

localip(interface, function(err, res) {
  if (err) {
    throw new Error('I have no idea what my local ip is.');
  }
  console.log('My local ip address on ' + interface + ' is ' + res);
});

"Docs"

Pretty self-explanatory. It is basically just a wrapper around require('os').networkInterfaces

localip(interface, callback)

Gets local ip and invokes callback with (err, res) as you might be used to in other modules in node.

License

MIT

Keywords

ip

FAQs

Package last updated on 05 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts