default-gateway
Advanced tools
Comparing version 5.0.4 to 5.0.5
{ | ||
"name": "default-gateway", | ||
"version": "5.0.4", | ||
"version": "5.0.5", | ||
"description": "Get the default network gateway, cross-platform.", | ||
@@ -12,12 +12,12 @@ "author": "silverwind <me@silverwind.io>", | ||
"engines": { | ||
"node": ">=8" | ||
"node": "^8.12.0 || >=9.7.0" | ||
}, | ||
"dependencies": { | ||
"execa": "^3.0.0" | ||
"execa": "^3.3.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "6.5.1", | ||
"eslint-config-silverwind": "4.2.3", | ||
"updates": "9.0.0", | ||
"ver": "5.4.2" | ||
"eslint": "6.6.0", | ||
"eslint-config-silverwind": "5.0.0", | ||
"updates": "9.0.1", | ||
"ver": "6.0.2" | ||
}, | ||
@@ -24,0 +24,0 @@ "files": [ |
@@ -6,4 +6,9 @@ # default-gateway | ||
Obtains the machine's default gateway through `exec` calls to OS routing interfaces. On Linux and Android, the `ip` command must be available (usually provided by the `iproute2` package). On IBM i, the `db2util` command must be available (provided by the `db2util` package). | ||
Obtains the machine's default gateway through `exec` calls to OS routing interfaces. | ||
- On Linux and Android, the `ip` command must be available (usually provided by the `iproute2` package). | ||
- On Windows, `wmic` must be available. | ||
- On IBM i, the `db2util` command must be available (provided by the `db2util` package). | ||
- On Unix (and macOS), the `netstat` command must be available. | ||
## Installation | ||
@@ -20,15 +25,13 @@ | ||
defaultGateway.v4().then(result => { | ||
// result = {gateway: '1.2.3.4', interface: 'en1'} | ||
}); | ||
const {gateway, interface} = await defaultGateway.v4(); | ||
// gateway = '1.2.3.4', interface = 'en1' | ||
defaultGateway.v6().then(result => { | ||
// result = {gateway: '2001:db8::1', interface: 'en2'} | ||
}); | ||
const {gateway, interface} = await defaultGateway.v6(); | ||
// gateway = '2001:db8::1', interface = 'en2' | ||
const result = defaultGateway.v4.sync(); | ||
// result = {gateway: '1.2.3.4', interface: 'en1'} | ||
const {gateway, interface} = defaultGateway.v4.sync(); | ||
// gateway = '1.2.3.4', interface = 'en1' | ||
const result = defaultGateway.v6.sync(); | ||
// result = {gateway: '2001:db8::1', interface: 'en2'} | ||
const {gateway, interface} = defaultGateway.v6.sync(); | ||
// gateway = '2001:db8::1', interface = 'en2' | ||
``` | ||
@@ -35,0 +38,0 @@ |
16327
54
Updatedexeca@^3.3.0