Socket
Socket
Sign inDemoInstall

default-gateway

Package Overview
Dependencies
17
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 2.0.2

4

darwin.js

@@ -19,5 +19,5 @@ "use strict";

if (family === "v4") {
[target, gateway, _flags, _ref, _use, iface] = line.split(/ +/) || [];
[target, gateway, _flags, _ref, _use, iface] = line.split(/ +/) || [];
} else {
[target, gateway, _flags, iface] = line.split(/ +/) || [];
[target, gateway, _flags, iface] = line.split(/ +/) || [];
}

@@ -24,0 +24,0 @@ if (dests.includes(target) && gateway && net.isIP(gateway)) {

{
"name": "default-gateway",
"version": "2.0.1",
"version": "2.0.2",
"description": "Get the default network gateway, cross-platform.",

@@ -19,9 +19,9 @@ "author": "silverwind <me@silverwind.io>",

"os": [
"win32",
"darwin",
"linux"
"linux",
"win32"
],
"files": [
"darwin.js",
"index.js",
"darwin.js",
"linux.js",

@@ -28,0 +28,0 @@ "win32.js"

@@ -6,3 +6,3 @@ # default-gateway

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).
Obtains the machine's default 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).

@@ -33,11 +33,10 @@ ## Installation

Returns a promise that resolves to a object containing the IPv4 `gateway` and `interface`. If it succeeds, `gateway` will always be defined, while `interface` can be `null` if it cannot be determined. Rejects when the gateway cannot be determined.
Returns a promise that resolves to a object containing the IPv4 `gateway` and `interface` properties. If it succeeds, `gateway` will always be defined, while `interface` can be `null` if it cannot be determined. Rejects when the gateway cannot be determined.
### defaultGateway.v6()
Returns a promise that resolves to a object containing the IPv6 `gateway` and `interface`. If it succeeds, `gateway` will always be defined, while `interface` can be `null` if it cannot be determined. Rejects when the gateway cannot be determined.
Returns a promise that resolves to a object containing the IPv6 `gateway` and `interface` properties. If it succeeds, `gateway` will always be defined, while `interface` can be `null` if it cannot be determined. Rejects when the gateway cannot be determined.
## License
© [silverwind](https://github.com/silverwind), distributed under BSD licence
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