Node.js events and emitters
Overview
Section titled OverviewIf you’re just coding in JavaScript, then maybe the built-in events are fine, but otherwise, you may want a library to handle events.
- mitt is very small and can handle TypeScript, although at the time of writing, there’s an issue preventing it from working with NodeNext as the
module
option in yourtsconfig
. - typed-event-emitter is a good fallback, although it requires the use of a
class
.