Get current battery level
Install
$ npm install battery-level
Usage
const batteryLevel = require('battery-level');
(async () => {
console.log(await batteryLevel());
//=> 0.55
})();
API
batteryLevel()
Returns a Promise<number>
with the battery level.
Related
- battery-level-cli - CLI for this module
- browser-battery - Get battery information in a browser
- is-charging - Find out if a computer is charging