Comparing version 0.3.0 to 0.3.2
@@ -6,3 +6,3 @@ "use strict"; | ||
async = require('async'); | ||
function trim_exec(cmd, cb) { | ||
@@ -47,3 +47,3 @@ exec(cmd, function(err, out) { | ||
exports.netmask_for = function(nic_name, cb) { | ||
var cmd = "ifconfig " + nic_name + " 2> /dev/null | egrep 'netmask|Mask:' | awk '{print $4}'"; | ||
var cmd = "ifconfig " + nic_name + " 2> /dev/null | egrep 'netmask|Mask:' | awk '{print $4}' | sed 's/Mask://'"; | ||
trim_exec(cmd, cb); | ||
@@ -68,2 +68,5 @@ }; | ||
exports.netmask_for(obj.name, cb) | ||
}, | ||
function(cb) { | ||
exports.interface_type_for(obj.name, cb) | ||
} | ||
@@ -74,2 +77,3 @@ ], function(err, results) { | ||
if (results[2]) obj.netmask = results[2]; | ||
if (results[3]) obj.type = results[3]; | ||
@@ -76,0 +80,0 @@ list.push(obj); |
{ | ||
"name": "network", | ||
"version": "0.3.0", | ||
"version": "0.3.2", | ||
"description": "Cross platform network utilities for Node.js (gateway_ip, MAC address, etc)", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -22,2 +22,6 @@ Network Utilies for Node.js | ||
##### CLI | ||
$ network public_ip | ||
## Get private IP | ||
@@ -33,2 +37,6 @@ | ||
##### CLI | ||
$ network private_ip | ||
## Get gateway IP | ||
@@ -43,2 +51,7 @@ | ||
``` | ||
##### CLI | ||
$ network gateway_ip | ||
## Get active interface | ||
@@ -65,2 +78,6 @@ | ||
##### CLI | ||
$ network active_interface | ||
## Get interfaces list | ||
@@ -90,2 +107,6 @@ | ||
##### CLI | ||
$ network interfaces_list | ||
# TODO | ||
@@ -92,0 +113,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15029
352
118