Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vodolaz095/acpiclient
NodeJS wrapper around http://sourceforge.net/projects/acpiclient/
https://github.com/vodolaz095/acpiclient
Last synced: about 4 hours ago
JSON representation
NodeJS wrapper around http://sourceforge.net/projects/acpiclient/
- Host: GitHub
- URL: https://github.com/vodolaz095/acpiclient
- Owner: vodolaz095
- License: mit
- Created: 2015-08-14T18:53:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-14T19:49:12.000Z (over 9 years ago)
- Last Synced: 2024-10-07T18:48:50.353Z (about 1 month ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# acpiclient
[![Build Status](https://travis-ci.org/vodolaz095/acpiclient.svg)](https://travis-ci.org/vodolaz095/acpiclient)
NodeJS wrapper around [http://sourceforge.net/projects/acpiclient/](http://sourceforge.net/projects/acpiclient/)
It outputs battery, temperature, adapter and cooling information as output of `acpi` command.# Requirements
You need to install [acpi](http://sourceforge.net/projects/acpiclient/).
It is present on all modern Linux distributions, at least at official repos```shell
$ su -c 'yum install acpi'
$ su -c 'apt-get install acpi'
$ su -c 'zypper install acpi'
$ su -c 'emerge [-a] acpi'```
# Example
```javascript
var acpiclient = require('acpiclient');
acpiclient(function (error, data) {
if (error) {
throw error;
}
console.log(data);
});
```Will output something like
```
{
"batteries": {
"0": {
"status": "Full",
"charge": 100,
"rate": ""
},
"1": {
"status": "Discharging",
"charge": 0,
"rate": "rate information unavailable"
}
},
"adapter": {
"0": {
"onLine": true
}
},
"thermal": {
"0": {
"status": "ok",
"temp": 51,
"degrees": "Celsius"
}
},
"cooling": {
"0": {
"status": "LCD 0 of 10"
},
"1": {
"status": "LCD 0 of 10"
},
"2": {
"status": "Processor 0 of 10"
},
"3": {
"status": "Processor 0 of 10"
},
"4": {
"status": "Processor 0 of 10"
},
"5": {
"status": "Processor 0 of 10"
}
},
"misc": []
}```