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

pidusage

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pidusage - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

13

lib/stats.js

@@ -132,3 +132,4 @@ var os = require('os')

var self = this
var uptime = os.uptime()
// Note: On Windows the returned value includes fractions of a second. Use Math.floor() to get whole seconds.
var uptime = Math.floor(os.uptime())

@@ -176,9 +177,13 @@ wmic.stdout.on('data', function(d) {

var seconds = history.uptime !== undefined ? uptime - history.uptime : 0
seconds = Math.abs(seconds)
seconds = seconds === 0 ? 1 : seconds //we sure can't divide through 0
var cpu = 0
if (seconds > 0) {
cpu = (total / seconds) * 100
}
self.history[pid] = stats
self.history[pid].uptime = uptime
return done(null, {cpu: (total / seconds) * 100, memory: workingsetsize})
return done(null, {cpu: cpu, memory: workingsetsize})
})

@@ -185,0 +190,0 @@ wmic.stdin.end()

{
"name": "pidusage",
"version": "1.1.5",
"version": "1.1.6",
"description": "Cross-platform process cpu % and memory usage of a PID — Edit",

@@ -12,2 +12,5 @@ "main": "index.js",

},
"engines": {
"node": ">=0.12"
},
"scripts": {

@@ -14,0 +17,0 @@ "test": "mocha test/test.js --reporter min && node test/stresstest.js"

Sorry, the diff of this file is not supported yet

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