I'm not new to programming, but new to NodeJS. I have a rather complex project that is now several modules deep, of course all rooted in app.js, similar to the following map:
App.js
requires('Module_a')
requires('Module_b')
requires('EventEmitter2');
Module_a.js
requires('Module_a1');
requires('Module_a2');
Module_b.js
requires('Module_b1');
requires('Module_b2');
I want events generated in Module_a2 to be visible up at app.js and all the way down to Module_b2, and b2 events visible in a2, and so on. How best do I make the same instance of EventEmitter globally visible to all the modules?
Many thanks for your help