Node module to read the CPU temperature and fan speed on osx using smc

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('node-smc');
console.log('Temperature:', smc.temperature());
var i, f =;
console.log('Fans:', f);
for (= 0; i < f; i++) {
    console.log('Fan', i, 'RPM:', smc.fanRpm(i));

On my Macbook Air this prints out the following:

Temperature: 35.625
Fans: 1
Fan 0 RPM: 1201

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.