Answer the question
In order to leave comments, you need to log in
How to make global eventEmitter in node.js server (express 4.x) ?
Greetings.
I want to make an eventEmitter that will be available in any module. What is the best way to organize it? Is there a 'best practice' for this case?
I 'm using express 4.x
PS tried this, didn't work:
var events = require('events');
global.eventEmitter = new events.EventEmitter();
global.eventEmitter.emit('testEvent');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question