Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

network

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

network - npm Package Compare versions

Comparing version 0.3.0 to 0.3.2

8

lib/linux.js

@@ -6,3 +6,3 @@ "use strict";

async = require('async');
function trim_exec(cmd, cb) {

@@ -47,3 +47,3 @@ exec(cmd, function(err, out) {

exports.netmask_for = function(nic_name, cb) {
var cmd = "ifconfig " + nic_name + " 2> /dev/null | egrep 'netmask|Mask:' | awk '{print $4}'";
var cmd = "ifconfig " + nic_name + " 2> /dev/null | egrep 'netmask|Mask:' | awk '{print $4}' | sed 's/Mask://'";
trim_exec(cmd, cb);

@@ -68,2 +68,5 @@ };

exports.netmask_for(obj.name, cb)
},
function(cb) {
exports.interface_type_for(obj.name, cb)
}

@@ -74,2 +77,3 @@ ], function(err, results) {

if (results[2]) obj.netmask = results[2];
if (results[3]) obj.type = results[3];

@@ -76,0 +80,0 @@ list.push(obj);

{
"name": "network",
"version": "0.3.0",
"version": "0.3.2",
"description": "Cross platform network utilities for Node.js (gateway_ip, MAC address, etc)",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -22,2 +22,6 @@ Network Utilies for Node.js

##### CLI
$ network public_ip
## Get private IP

@@ -33,2 +37,6 @@

##### CLI
$ network private_ip
## Get gateway IP

@@ -43,2 +51,7 @@

```
##### CLI
$ network gateway_ip
## Get active interface

@@ -65,2 +78,6 @@

##### CLI
$ network active_interface
## Get interfaces list

@@ -90,2 +107,6 @@

##### CLI
$ network interfaces_list
# TODO

@@ -92,0 +113,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc