0.1.2 • Published 9 years ago

ifconfig-defaultgateway v0.1.2

Weekly downloads
2
License
-
Repository
github
Last release
9 years ago

ifconfig-defaultgateway

ifconfig-defaultgateway is a node.js library to parse ifconfig and get the default gateway on a linux machine.

Currently only tested on Debian (Raspberry Pi)

Install

You can install ifconfig-defaultgateway using the Node Package Manager (npm):

npm install ifconfig-defaultgateway

Examples

var network = require('ifconfig-defaultgateway');

network.ifconfig(function (err, interfaces) {
    if(err) return console.log(err);
    console.log('\nIFCONFIG INTERFACES:\n', interfaces);
});

network.route(function (err, routes) {
    if(err) return console.log(err);
    console.log('\nROUTE ROUTES:\n', routes);
});

network.getNetworkInfo(function (err, interfaces) {
    if(err) return console.log(err);
    console.log('\nNETWORK INFO INTERFACES (WITH DEFAULT GATEWAY):\n', interfaces);
});