node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


Node SMC

This node module uses Apple's SMC subsystem to query the system for the CPU temperature, number of fans and for each of the fans retrieves the current RPM.

This packages works on OSX only.


npm install smc


var smc = require('smc');
Object.keys(smc.metrics).forEach(function(key) {
  var value = smc.get(key);
  if (value > 0) {
    console.log(key, smc.metrics[key]+':', value);
var i, f =;
for (= 0; i < f; i++) {
  console.log('F'+i+'Ac', 'Fan', i, 'RPM:', smc.fanRpm(i));

On my Macbook Pro this prints out the following:

TB0T Battery TS_MAX: 34.59765625
TB1T Battery 1: 34.59765625
TB2T Battery 2: 32.59765625
TC0E CPU 0 ??: 80.56640625
TC0F CPU 0 ??: 82.16015625
TC0P CPU 0 Proximity: 65.875
TC1C Core 1: 77
TC2C Core 2: 78
TC3C Core 3: 77
TC4C Core 4: 75
Th1H NB/CPU/GPU HeatPipe 1 Proximity: 51.625
TM0P Memory Slot Proximity: 53.125
TM0S Memory Slot 1: 53.1171875
TPCD Platform Controller Hub Die: 57
Ts0P Palm rest L: 32.5
Ts0S Memory Bank Proximity: 40.23046875
TW0P AirPort Proximity: 48.5
F0Ac Fan 0 RPM: 2160
F1Ac Fan 1 RPM: 2001


Most of the work was done by Sébastien Lavoie in his osx-cpu-temp code. I just took it and made it into a node module, as it was convenient for me to use it that way.

Additional credit goes to Hendrik Holtmann, the author of smcFanControl as his code inspired osx-cpu-temp and as I used part of the code of smcFanControl to query the fan speed and format the result.


GNU General Public License, version 2


Make it asynchronous, as currently everything happens synchronously.