Comparing version 1.0.1 to 1.0.2
#!/usr/bin/env node | ||
var http = require('http'); | ||
var os = require('os'); | ||
var colors = require('colors'); | ||
http.request({ | ||
host: 'ifconfig.me', | ||
path: '/ip', | ||
}, function (res) { | ||
res.on('data', function (chunk) { | ||
console.log('External IP Addr: ' + colors.yellow(chunk)); | ||
}); | ||
}).end(); | ||
var ifaces = os.networkInterfaces(); | ||
@@ -11,8 +21,4 @@ | ||
iface.forEach(function (conn) { | ||
if (conn.family === 'IPv4') { | ||
if (conn.internal) { | ||
console.log('Internal IP Addr: ' + colors.green(conn.address)); | ||
} else { | ||
console.log('External IP Addr: ' + colors.yellow(conn.address)); | ||
} | ||
if (conn.family === 'IPv4' && !conn.internal) { | ||
console.log('Internal IP Addr: ' + colors.green(conn.address)); | ||
} | ||
@@ -19,0 +25,0 @@ }); |
{ | ||
"name": "iplog", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Log you internal and external IP addr", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -11,4 +11,4 @@ #IP Log | ||
``` | ||
Internal IP Addr: 127.0.0.1 | ||
External IP Addr: 10.252.26.78 | ||
Internal IP Addr: 10.252.26.78 | ||
External IP Addr: 63.245.221.32 | ||
``` | ||
@@ -15,0 +15,0 @@ |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
1624
21
1