A TypeScript-first, type-safe replacement for EventEmitter with a gentle learning curve.
EVT is a TypeScript-native library that provides a type-safe alternative to traditional event emitters like Node.js's EventEmitter. It solves common pain points in event-driven architectures by enforcing type safety, enabling precise listener management, and offering promise-based event waiting. The library is designed to work across all JavaScript runtimes including Deno, Node.js, and browsers.
TypeScript developers building event-driven applications who need type safety and better control over event listeners, particularly those working in Deno, Node.js, or React environments.
Developers choose EVT over EventEmitter for its robust TypeScript integration and over RxJS for its gentler learning curve and more intuitive API, making it ideal for teams that want type safety without the complexity of reactive programming.
💧EventEmitter's typesafe replacement
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides compile-time type safety for event payloads, catching errors early as highlighted in the README's emphasis on type inference.
Works in Deno, Node.js, browsers, and React Native without external dependencies, making it versatile for any JS runtime.
Allows removal of anonymous listeners and conditional one-time listeners, addressing key limitations of EventEmitter.
Supports waiting for events via Promises with timeouts or conditions, simplifying asynchronous code as demonstrated in the motivations.
Includes dedicated hooks for seamless integration with React applications, reducing boilerplate in UI components.
Its core value relies on TypeScript, so it offers little benefit for plain JavaScript projects and requires TypeScript >= 3.8.
Lacks the extensive operator set of RxJS, making it unsuitable for complex reactive programming needs beyond basic event handling.
Depends on other libraries from the same author (tsafe, run-exclusive, minimal-polyfills), which could pose maintenance risks if support wanes.