Socket
Socket
Sign inDemoInstall

default-gateway

Package Overview
Dependencies
1
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc