You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

pidusage

Package Overview
Dependencies
Maintainers
4
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pidusage

Cross-platform process cpu % and memory usage of a PID

4.0.1
latest
Source
npmnpm
Version published
Weekly downloads
3.1M
5.64%
Maintainers
4
Weekly downloads
 
Created

What is pidusage?

The pidusage npm package is a cross-platform process and system monitoring library. It provides statistics such as CPU usage, memory usage, running time, and more for a given process ID (PID). It's particularly useful for monitoring the resource consumption of processes in Node.js applications.

What are pidusage's main functionalities?

Process Statistics

This feature allows you to monitor the resource usage of a specific process. The code sample demonstrates how to get statistics such as CPU and memory usage for the current process.

const pidusage = require('pidusage');
pidusage(process.pid, function (err, stats) {
  console.log(stats);
});

Monitoring Multiple PIDs

Pidusage also supports monitoring multiple processes at once. This code sample shows how to get statistics for multiple PIDs simultaneously.

const pidusage = require('pidusage');
pidusage([1234, 5678], function (err, stats) {
  console.log(stats);
});

Other packages similar to pidusage

Keywords

pid

FAQs

Package last updated on 26 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts