Skip to content

ElectronPowerMonitor.on('on-battery') method

ElectronPowerMonitor › on(‘on-battery’)

Unofficial

Emitted when the system changes to battery power.

Signature:

on($event: "on-battery", listener: () => void): this

Parameters:

ParameterTypeDescription
$event"on-battery"
listener() => voidCallback invoked when the event is emitted.

Returns: this — This PowerMonitor instance. Platform: darwin.