default-gateway
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "default-gateway", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Get the default network gateway, cross-platform.", | ||
@@ -5,0 +5,0 @@ "author": "silverwind <me@silverwind.io>", |
@@ -5,3 +5,3 @@ # default-gateway | ||
Obtains the network gateway through `exec` calls to OS routing interfaces. Supports Linux, macOS and Windows. | ||
Obtains the network gateway through `exec` calls to OS routing interfaces. Supports Linux, macOS and Windows. On Linux, the `ip` command must be available (usually provided by the `iproute2` package). | ||
@@ -8,0 +8,0 @@ ## Installation |
@@ -8,3 +8,3 @@ "use strict"; | ||
return new Promise(function(resolve, reject) { | ||
let gateway, gwid, iface; | ||
let gateway, gwid; | ||
exec("wmic path Win32_NetworkAdapterConfiguration where IPEnabled=true get DefaultIPGateway,Index /format:table", function(_, gwtable) { | ||
@@ -24,5 +24,4 @@ exec("wmic path Win32_NetworkAdapter get Index,NetConnectionID /format:table", function(_, iftable) { | ||
const name = line.substr(spaceIndex + 1).trim(); | ||
if (id === gwid && name) { | ||
iface = name; | ||
resolve({gateway: gateway, interface: iface}); | ||
if (id === gwid) { | ||
resolve({gateway: gateway, interface: name ? name : null}); | ||
return true; | ||
@@ -29,0 +28,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
5095
1
41