network-address
Advanced tools
Comparing version 0.0.2 to 0.0.3
var os = require('os'); | ||
var networkAddress = function() { | ||
module.exports = function() { | ||
var interfaces = os.networkInterfaces(); | ||
@@ -12,6 +12,2 @@ for (var i in interfaces) { | ||
return '127.0.0.1'; | ||
}; | ||
module.exports = function(port) { | ||
return port ? networkAddress()+':'+port : networkAddress(); | ||
}; |
{ | ||
"name":"network-address", | ||
"version":"0.0.2", | ||
"version":"0.0.3", | ||
"dependencies": {}, | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com/mafintosh/network-address", |
@@ -13,3 +13,8 @@ ## network-address | ||
console.log(address()); // prints something like 192.168.3.102 | ||
console.log(address(2444)) // prints something like 192.168.3.102:2444 | ||
``` | ||
it is also available as a command line tool | ||
npm install -g network-address | ||
you are now able to run `network-address` in your terminal |
19
1083
12