Is there a way to only allow certain events in a custom eventEmitter? For example, if I have something like this everything works as expected: I get a callback every second on the first event and every 2 seconds on the 2nd event. For the 3rd nothing happens, because I don’t emit this event. Is there a way that this
Tag: eventemitter
On an EventEmitter, how can I know all the events I can listen to?
Supposing I have an object that inherited from EventEmitter, like a stream or any other, is there a good way to know all the events I can listen to, and all the attached event listeners ? I think the second part of the question is easy, emitter.listeners(event) will tell me all the listeners to an event. But is there a