Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/d0mih/macos-system-info
Node bindings to communicate with the Apple SMC.
https://github.com/d0mih/macos-system-info
apple nodejs npm-package osx smc typescript
Last synced: 22 days ago
JSON representation
Node bindings to communicate with the Apple SMC.
- Host: GitHub
- URL: https://github.com/d0mih/macos-system-info
- Owner: D0miH
- License: mit
- Created: 2019-05-24T15:33:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T07:16:46.000Z (almost 2 years ago)
- Last Synced: 2024-05-14T00:08:16.776Z (6 months ago)
- Topics: apple, nodejs, npm-package, osx, smc, typescript
- Language: C++
- Homepage:
- Size: 424 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# macos-system-info
[![Build Status](https://img.shields.io/travis/D0miH/macos-system-info.svg?style=flat-square)](https://travis-ci.org/D0miH/macos-system-info) [![npm](https://img.shields.io/npm/v/macos-system-info.svg?style=flat-square)](https://www.npmjs.com/package/macos-system-info)
### Library to easily read system information about your mac using Node.js
## Installation
```sh
npm install macos-system-info
```or
```sh
yarn add macos-system-info
```## Documentation
You can find the documentation [here](https://d0mih.github.io/macos-system-info/).
## Usage
This little code snipped shows how to read the current CPU temperature:
```javascript
// 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:
```javascript
// 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();
```