Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brendanashworth/libsmc
libsmc is a node.js package that retrieves info from the Apple System Management Controller API
https://github.com/brendanashworth/libsmc
apple fan libsmc smc temperature
Last synced: 9 days ago
JSON representation
libsmc is a node.js package that retrieves info from the Apple System Management Controller API
- Host: GitHub
- URL: https://github.com/brendanashworth/libsmc
- Owner: brendanashworth
- License: other
- Created: 2017-06-12T23:12:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-21T05:13:45.000Z (almost 7 years ago)
- Last Synced: 2024-10-28T17:17:00.504Z (19 days ago)
- Topics: apple, fan, libsmc, smc, temperature
- Language: C++
- Size: 25.4 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# libsmc
[![Build Status](https://travis-ci.org/brendanashworth/libsmc.svg?branch=master)](https://travis-ci.org/brendanashworth/libsmc)
[![NPM version](https://badge.fury.io/js/libsmc.svg)](http://badge.fury.io/js/libsmc)> libsmc is a node.js binding to [libsmc](https://github.com/beltex/libsmc).
It retrieves info from the Apple System Management Controller API. The SMC
manages temperature and power within the machine.## API
### `smc.isBatteryPowered()`
Checks whether or not the machine is running on battery power. Returns a
`bool` value.```javascript
var smc = require('libsmc');var usingBattery = smc.isBatteryPowered();
// => false
```### `smc.isOpticalDiskDriveFull()`
Checks whether or not the optical disk drive (ODD) of the machine has a disk
in it. Returns a `bool` value.```javascript
var smc = require('libsmc');var hasDisk = smc.isOpticalDiskDriveFull();
// => true
```### `smc.getNumberOfFans()`
Gets the number of fans a machine has. Returns an `int` value.```javascript
var smc = require('libsmc');var number = smc.getNumberOfFans();
// => 2
```### `smc.getFan(number)`
Gets the information related to a specific fan. `number` is a positive integer
unique to that fan, starting at 0. Returns an object of format
`{ name, speed }`, where `name` is the given name from the machine, and `speed`
is the RPM (rotations per minute) of the fan at that point in time.```javascript
var smc = require('libsmc');var fan = smc.getFan(0);
// => { name: 'ExhaustZ', speed: 2176 }
```## License
MIT license. beltex's libsmc is [licensed separately](./deps/libsmc/LICENSE).