Check if a specific battery is present
MIT License
Check if a specific battery is present. Probably only works on Linux.
var batteryPresent = require('battery-present');
batteryPresent('BAT0', function(exists) {
console.log(exists);
// true
});
$ npm install battery-present
var batteryPresent = require('battery-present');
batteryPresent([battery='BAT0'], callback)
Given an optional String battery
(defaults to 'BAT0'
), calls
callback(true)
if that battery
exists in the current system. Otherwise calls
callback(false)
.