@ismaillowkey/node-red-contrib-pcresource 1.0.0
A Node-RED node to fetch PC resources like CPU usage, RAM, etc.
node-red-contrib-pcresource
A comprehensive Node-RED node package to fetch real-time PC hardware and system resources. This package uses the systeminformation library to provide detailed data on CPU, RAM, Disk, OS, and more across Windows, Linux, and macOS.
Installation
Run the following command in your Node-RED user directory (typically ~/.node-red or %USERPROFILE%\.node-red on Windows):
npm install node-red-contrib-pcresource
Nodes
This package provides 5 distinct nodes grouped under the pc resource category in your Node-RED palette:
1. pc resource (All-in-One)
Fetches a comprehensive, aggregated list of available PC metrics concurrently.
- Designed with built-in timeouts and error handling to prevent system hangs on slower platforms (e.g., Windows WMI).
- Returns deep nested objects covering
cpu,memory,os,system,disk,fileSystems,network,graphics, andbattery.
2. get cpu
Fetches real-time CPU statistics.
- Data payload:
usagePercent,totalCore,manufacturer,brand.
3. get ram
Fetches current Memory (RAM) statistics.
- Data payload:
usagePercent,freeSpacePercent,totalRAMGB,usageGB,freeGB.
4. get disk
Fetches aggregate disk usage and free space across all mounted drives.
- Data payload:
usagePercent,freeSpacePercent,totalUsageGB,freeSpaceGB.
5. get os
Fetches operating system details and system uptime.
- Data payload:
platform,distro,release,kernel,arch,hostname,uptimeSeconds,uptimeHours.
Usage & Outputs
Simply trigger any of the nodes with any input (e.g., using an Inject node) to fetch the resource metrics.
Each node provides exactly 2 outputs:
- Output 1 (Top): Yields the requested resource data inside
msg.payloadas a JSON object. - Output 2 (Bottom): Yields an error message inside
msg.payloadif the fetch operation fails.