New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sockstat

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sockstat - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

10

index.js

@@ -1,2 +0,2 @@

const exec = require('child_process').exec;
const fs = require('fs');

@@ -7,3 +7,3 @@ exports.get = function () {

// Run the sockstat terminal command
exec('cat /proc/net/sockstat', function (error, stdout, stderr) {
fs.readFile('/proc/net/sockstat', 'utf8', function (error, data) {
// Sockstat command failed?

@@ -13,6 +13,2 @@ if (error)

// Sockstat command returned an error?
if (stderr)
return reject(new Error('Sockstat error: ' + stderr));
// Define RegEx pattern to extract stats from the sockstat command output (is there a better way to do this?)

@@ -36,3 +32,3 @@ const pattern = /sockets: used ([0-9]+) TCP: inuse ([0-9]+) orphan ([0-9]+) tw ([0-9]+) alloc ([0-9]+) mem ([0-9]+) UDP: inuse ([0-9]+) mem ([0-9]+) UDPLITE: inuse ([0-9]+) RAW: inuse ([0-9]+) FRAG: inuse ([0-9]+) memory ([0-9]+)/;

fragMem
] = pattern.exec(stdout.replace(/\n/g, ' ')) || [];
] = pattern.exec(data.replace(/\n/g, ' ')) || [];

@@ -39,0 +35,0 @@ // Parse failed?

{
"name": "sockstat",
"version": "1.0.0",
"version": "1.0.1",
"description": "A package that parses the /proc/net/sockstat file for socket connectivity statistics.",

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

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