Skip to content

Instantly share code, notes, and snippets.

@ishitcno1
Created April 24, 2015 03:26
Show Gist options
  • Save ishitcno1/0b372000a38e7f0e89d3 to your computer and use it in GitHub Desktop.
Save ishitcno1/0b372000a38e7f0e89d3 to your computer and use it in GitHub Desktop.
nodejs get ipv4 ip
var os = require('os');
var ip = '127.0.0.1';
os.networkInterfaces().wlan0.forEach(function(ni) {
if (ni.family === 'IPv4')
ip = ni.address;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment