Comparing version 0.5.0 to 0.6.0
@@ -78,2 +78,6 @@ "use strict"; | ||
}; | ||
exports.status_for = function(nic_name, cb){ | ||
var cmd = "netstat -rn | grep " + nic_name + ' | grep UG | wc -l | sed -e "s/1/active/" | sed -e "s/0/inactive/"' | ||
trim_exec(cmd, cb) | ||
} | ||
@@ -93,2 +97,5 @@ exports.get_network_interfaces_list = function(cb) { | ||
exports.netmask_for(obj.name, cb) | ||
}, | ||
function(cb){ | ||
exports.status_for(obj.name, cb) | ||
} | ||
@@ -98,2 +105,3 @@ ], function(err, results) { | ||
if (results[1]) obj.netmask = results[1]; | ||
if (results[2]) obj.status = results[2] | ||
@@ -115,2 +123,3 @@ list.push(obj); | ||
name = block.match(/Device: (\w+)/); | ||
@@ -124,3 +133,3 @@ if (!parts || !mac || !name) | ||
obj.name = name[1]; | ||
// obj.desc = port; | ||
obj.desc = port; | ||
obj.type = determine_nic_type(port); | ||
@@ -127,0 +136,0 @@ obj.ip_address = null; |
"use strict"; | ||
var needle = require('needle'), | ||
os_functions = require('./' + process.platform); | ||
var needle = require('needle'); | ||
var os_functions; | ||
switch (process.platform) { | ||
case 'win32': | ||
os_functions = require('./win32'); | ||
break; | ||
case 'linux': | ||
os_functions = require('./linux'); | ||
break; | ||
case 'darwin': | ||
os_functions = require('./darwin'); | ||
break; | ||
} | ||
// var ip_regex = /((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})/; | ||
@@ -7,0 +17,0 @@ var ip_regex = /(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b)/; |
{ | ||
"name": "network", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "Cross platform network utilities for Node.js (gateway_ip, MAC address, etc)", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
18718
398
0