node-ps-data

Gets data about running processes by process id.

Usage no npm install needed!

<script type="module">
  import nodePsData from 'https://cdn.skypack.dev/node-ps-data';
</script>

README

node-ps-data

GitHub version Build Release NPM version NPM downloads License GPL-3.0

Get data about process resources without executing terminal commands

  • That's right. Unlike existing tools, this module directly retrieves data about processes without needing to open a new shell and wait for a terminal command's response.
  • Supports both Windows and Linux
  • NodeJS module written in C++
  • Prebuilt binaries for linux-x64 and win32-x64

Features

  • cpuUserTime(pid): Get user-mode CPU usage for a process in milliseconds.
  • cpuKernelTime(pid): Get kernel/system-mode CPU usage for a process in milliseconds.
  • cpuTime(pid): Get total CPU usage for a process in milliseconds.
  • memInfo(pid): Get current memory usage for a process in bytes.

Installation

npm install node-ps-data

Known Issues and Future Plans

  • Build more binaries for other platforms and architectures.
  • More library functions:
    • CPU/Memory subcategories (e.g. child process time, pages info, etc.)
    • Disk usage
    • Network usage
    • More!