README
smc-node-kit
Library to easily communicate with the Apple SMC through Node.js
Installation
npm install smc-node-kit
or
yarn add smc-node-kit
Documentation
You can find the documentation here.
Usage
This little code snipped shows how to read the current CPU temperature:
// import the class
const { SMCNodeKit } = require('smc-node-kit');
// create a new instance of the class and open the connection to the SMC
const smcKit = new SMCNodeKit();
smcKit.open();
// read the cpu temperature
console.log(smcKit.getCpuTemp());
// close the connection to the SMC
smcKit.close();
If you are using typescript you can use named imports:
// import the class
import { SMCNodeKit } from 'smc-node-kit';
// create a new instance of the class and open the connection to the SMC
const smcKit: SMCNodeKit = new SMCNodeKit();
smcKit.open();
// read the cpu temperature
console.log(smcKit.getCpuTemp());
// close the connection to the SMC
smcKit.close();