@juhan280/typed-emitter
v1.0.0
Published
The type re-declaration of the `EventEmitter` class defined and exposed by the `node:events` module.
Downloads
3
Maintainers
Readme
typed-emitter
The type re-declaration of the EventEmitter
class defined and exposed by the node:events
module.
import { EventEmitter } from '@juhan280/typed-emitter';
type Events = {
message: [message: string];
}
const emitter = new EventEmitter<Events>();
emitter.on("message", message => console.log(messsage));
emitter.emit("message", "Hello World");