battery-percentage
v1.0.0
Published
Get current MacOS battery level
Downloads
3
Maintainers
Readme
battery-percentage
Get current MacOS battery level
Works on macOS only.
Install
$ npm install --global battery-percentage
Usage
const batteryPercentage = require('battery-percentage')
batteryPercentage().then(percentage => {
console.log(percentage)
})
// 36%
batteryPercentage({ verbose: true }).then(percentage => {
console.log(percentage)
})
// 36%; charging; 3:36 remaining
Related
- battery-percentage-cli - CLI for this module
- battery-level - Get current battery level
License
MIT © Andrea Amorosi