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