Tiny type-safe event emitter for Node.js.
No implementation, just re-export renamed EventEmitter
with customized typings.
npm i @tiny-libs/typed-event-emitter
import { TypedEventEmitter } from '@tiny-libs/typed-event-emitter'
type MyEvents = {
connected: () => void
error: (code: string, error: Error) => void
}
class MyClass extends TypedEventEmitter<MyEvents> {
// ...
}
MIT copyright © 2023-present alex wei