Get current battery level
$ npm install battery-level
const batteryLevel = require('battery-level');
batteryLevel().then(level => {
console.log(level);
//=> 0.55
});
$ npm install --global battery-level
$ battery-level --help
Usage
$ battery-level
55%
- browser-battery - Get battery information in a browser
- is-charging - Find out if a computer is charging
MIT © Andreas Gillström