To achieve this in the cleanest way possible (and to also make this usable by anyone who might need this), I took the EventEmitter interface from nodejs, replicated it in more modern code, added support for awaiting the execution of all listeners, and made it its own module.
There's no difference otherwise. The code does (almost) the exact same things the nodejs core code does (bar the catch handling for promises: the rejections will always be handled and emitted as error events).
To achieve this in the cleanest way possible (and to also make this usable by anyone who might need this), I took the EventEmitter interface from nodejs, replicated it in more modern code, added support for awaiting the execution of all listeners, and made it its own module.
There's no difference otherwise. The code does (almost) the exact same things the nodejs core code does (bar the catch handling for promises: the rejections will always be handled and emitted as error events).