macos-system-info
v2.2.1
Published
Node.js bindings to read system information about your mac.
Downloads
33
Maintainers
Readme
macos-system-info
Library to easily read system information about your mac using Node.js
Installation
npm install macos-system-info
or
yarn add macos-system-info
Documentation
You can find the documentation here.
Usage
This little code snipped shows how to read the current CPU temperature:
// import the class
const { SystemInfo } = require('macos-system-info');
// create a new instance of the class and open the connection to the SMC
const systemInfo = new SystemInfo();
systemInfo.open();
// read the cpu temperature
console.log(systemInfo.getCpuTemp());
// close the connection to the SMC
systemInfo.close();
If you are using typescript you can use named imports:
// import the class
import { SystemInfo } from 'macos-system-info';
// create a new instance of the class and open the connection to the SMC
const systemInfo: SystemInfo = new SystemInfo();
systemInfo.open();
// read the cpu temperature
console.log(systemInfo.getCpuTemp());
// close the connection to the SMC
systemInfo.close();