npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

find-external-interface

1.0.0 • Public • Published

find-external-interface

Build Status Dependency Status Coverage Status

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
    • options.IPv6 boolean? If true, find IPv6 interface (optional, default false)
    • options.name string? If set, only check interface w/ this name for external address

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.

install

npm i find-external-interface

Downloadsweekly downloads

7

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability