Skip to content

Instantly share code, notes, and snippets.

@davengeo
Last active September 15, 2016 19:34
Show Gist options
  • Save davengeo/5750505d21316f47d20aac0337c0d0fe to your computer and use it in GitHub Desktop.
Save davengeo/5750505d21316f47d20aac0337c0d0fe to your computer and use it in GitHub Desktop.
getIpvalue in javascript
function getPublicAddress() {
let interfaces = os.networkInterfaces();
return _.chain(interfaces)
.filter(function(o) {
return o[0].family == 'IPv4' && !_.startsWith(o[0].address, '192.168');
})
.flatten()
.value();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment