battery
v1.0.1
Published
Get battery level and charging status.
Downloads
331
Maintainers
Readme
battery
Get battery level and charging status.
Install
npm install battery
Usage
const battery = require("battery");
(async () => {
const { level, charging } = await battery();
console.log(level);
//=> 0.8
console.log(charging);
//=> true
})();
API
battery()
Related
- battery-cli CLI for this module.