find-external-interface
v1.0.0
Published
Find the name of a network interface bound to an external (non-localhost) IP address
Downloads
11
Maintainers
Readme
find-external-interface
Find the name of a network interface bound to an external (non-localhost) IP address
Usage
This module exports a single function, findExternalInterface.
findExternalInterface
Find the name of a network interface bound to an external (non-localhost) IP address or null
if none found. This function returns the name of the first interface which satisfies the criteria.
Parameters
options
Object? Options
Examples
const {findExternalInterface} = require('find-external-interface');
const name = findExternalInterface(); // 'eth0'
const info = require('os').networkInterfaces(name); // ip address, etc.
Returns string? Interface name
Installation
$ npm install find-external-interface
Requirements
- Node.js v4.0.0 or greater
License
© 2017 Christopher Hiller. Licensed MIT.