2.2.1 • Published 5 years ago

macos-system-info v2.2.1

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

macos-system-info

Build Status npm

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