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"The event name.
listener() => voidCallback invoked when the event is emitted.

Returns: thisThis PowerMonitor instance. Platform: darwin.