Last active
September 15, 2016 19:34
-
-
Save davengeo/5750505d21316f47d20aac0337c0d0fe to your computer and use it in GitHub Desktop.
getIpvalue in javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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