npm.io
1.2.0 • Published 7 years ago

smc-node-kit

Licence
MIT
Version
1.2.0
Deps
2
Size
103 kB
Vulns
0
Weekly
0
Stars
2
DeprecatedThis package is deprecated
Install scriptsThis package runs scripts during installation (preinstall/install/postinstall)

smc-node-kit

Build Status npm

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();

Keywords