Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gillstrom/battery-level
Get current battery level
https://github.com/gillstrom/battery-level
battery battery-level javascript node
Last synced: 3 days ago
JSON representation
Get current battery level
- Host: GitHub
- URL: https://github.com/gillstrom/battery-level
- Owner: gillstrom
- License: mit
- Created: 2015-05-23T23:21:14.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-09-26T11:31:21.000Z (over 5 years ago)
- Last Synced: 2024-04-25T08:22:14.237Z (9 months ago)
- Topics: battery, battery-level, javascript, node
- Language: JavaScript
- Size: 35.2 KB
- Stars: 197
- Watchers: 6
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
> Get current battery level
## Install
```
$ npm install battery-level
```## Usage
```js
const batteryLevel = require('battery-level');(async () => {
console.log(await batteryLevel());
//=> 0.55
})();
```## API
### batteryLevel()
Returns a `Promise` with the battery level.
## Related
* [battery-level-cli](https://github.com/gillstrom/battery-level-cli) - CLI for this module
* [browser-battery](https://github.com/gillstrom/browser-battery) - Get battery information in a browser
* [is-charging](https://github.com/gillstrom/is-charging) - Find out if a computer is charging