You need to be careful making use of RED.events since this is used internally by Node-RED. It would be easy to end up with a clashing event name and that could be super hard to diagnose.
Funnily enough I had a brief discussion with Dave about that the other day.
You might want to create your own event listener, it is pretty easy as it is a standard Node.js library.
Hey thanks for the Info with the clash possibillity.
I'll keep it in mind.
Yes it is nothing for every user. Im working on a project extending nodered for my company. And we are using a node with a c++ compiled code inside which establishes a communication with an company protocol. These nodes are sharing the same lib.
So it can be possible that 2 different nodes using internaly the same c++ client.
I needed a way to inform all nodes that the global configuration file has been changed. So that they can disconnect and reestablish the connection with new configuration
In that case, I recommend creating your own event handler, that will be much safer and really no harder.
This package, while not specifically Node-RED (it works anywhere but I import it and use it in Node-RED, I'll probably get round to writing a proper node-red node one day!) makes extensive use of events.