Socket
Socket
Sign inDemoInstall

procfs-stats

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

procfs-stats - npm Package Compare versions

Comparing version 0.0.6 to 1.0.0

lib/nettable.js

22

index.js
var fs = require('fs');
var hexip = require('hexip');
var parseaddr = require('./lib/parse-addr')
var nettable = require('./lib/nettable')

@@ -186,7 +188,7 @@ // read the procfs stat file for a pid

fs.readFile(procPath+"net/tcp",function(err,buf){
fs.readFile(__dirname+'/test/tcp-example'||procPath+"net/tcp",function(err,buf){
var t = nettable(buf);
t.forEach(function(con){
con.rem_address = fixaddr(con.rem_address);
con.local_address = fixaddr(con.local_address);
con.rem_address = parseaddr(con.rem_address);
con.local_address = parseaddr(con.local_address);
});

@@ -207,4 +209,4 @@ cb(err,t,buf);

t.forEach(function(con){
con.rem_address = fixaddr(con.rem_address);
con.local_address = fixaddr(con.local_address);
con.rem_address = parseaddr(con.rem_address);
con.local_address = parseaddr(con.local_address);
});

@@ -348,3 +350,6 @@ cb(err,t,buf);

function nettable(data){
module.exports._nettable = _nettable
function _nettable(data){
if(!data) return false;

@@ -422,7 +427,2 @@ var lines = data.toString().trim().split("\n");

function fixaddr(addr){
addr = addr.split(':');
return hexip(addr[0])+':'+hexip.port(addr[1]);
}
function nulldelim(buf){

@@ -429,0 +429,0 @@ if(!buf) return false;

{
"name": "procfs-stats",
"version": "0.0.6",
"version": "1.0.0",
"description": "get detailed information (more than ps, top etc) about running process on linux machines from node.",

@@ -15,3 +15,4 @@ "main": "index.js",

"dependencies": {
"hexip": "~1.0.1"
"hexip": "~1.0.1",
"lru-cache": "^4.0.0"
},

@@ -18,0 +19,0 @@ "repository": {

@@ -13,1 +13,3 @@

});
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