Created
January 11, 2021 06:14
-
-
Save hideack/80bf5b4897172d2f6a4edd06900f3316 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const execa = require('execa'); | |
const plist = require('simple-plist'); | |
(async () => { | |
const {stdout} = await execa('ioreg', ['-k', 'BatteryPercent', '-r', '-a']); | |
let data = plist.parse(stdout); | |
console.log(data); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment