Ron Wang
Ron Wang

Reputation: 68

How to read hard disk utilization and stats using node.js or electronjs for windows and mac

I'm wondering how could I read hard disk utilization / idle time, hdd type using Javascript for Windows and MacOS. I have access to nodejs and electron API for my app. I can't seem to find any API or npm packages that allow reading of harddisk stats and disk utilization.

Upvotes: 0

Views: 2944

Answers (1)

Tarun Khurana
Tarun Khurana

Reputation: 1037

There is 1 npm package "systeminformation" which provides these details : Below is the reference : https://www.npmjs.com/package/systeminformation

const si = require('systeminformation');


setInterval(function() {
    si.mem(function(data) {
        console.log('Memory-Information:');
        console.log(data);
    });
}, 1000)

Upvotes: 4

Related Questions