@node-red/runtime.events

Runtime events emitter

emit(eventName) → {Boolean}

Emit an event to all of its registered listeners

Parameters:
Name Type Description
eventName String

the name of the event to emit

...args any

the arguments to pass in the event

Returns:
Type:
Boolean
  • whether the event had listeners or not

on(eventName, listener)

Register an event listener for a runtime event

Parameters:
Name Type Description
eventName String

the name of the event to listen to

listener function

the callback function for the event