Comparing version 1.0.1 to 1.0.2
13
index.js
@@ -9,5 +9,12 @@ #!/usr/bin/env node | ||
// gets the external IPv4 address | ||
let addresses = networkInterfaces.en1 | ||
.filter(address => address.family === 'IPv4' && !address.internal) | ||
.map(address => address.address); | ||
let addresses = []; | ||
Object.keys(networkInterfaces).forEach(interfaceName => { | ||
let networkInterfaceAddresses = networkInterfaces[interfaceName]; | ||
networkInterfaceAddresses | ||
.filter(address => address.family === 'IPv4' && !address.internal) | ||
.map(address => address.address) | ||
.forEach(address => { | ||
addresses.push(address); | ||
}); | ||
}); | ||
@@ -14,0 +21,0 @@ // in case you want to use this in another js file |
{ | ||
"name": "print-ip", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Command-line tool for getting your IP on the LAN", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
2131
36