context-emitter

A simple extension of node's EventEmitter that permits setting the context of emitter events.

context-emitter

A simple extension of node's EventEmitter that permits setting the context of emitted events.

npm install context-emitter

Returns the base class for the emitter.

You can either extend a class with ContextEmitter, or instantiate it directly. Either way, the first argument is optional and will set the context to run event handlers from.

Set the ctx property of the emitter to change emitted functions' contexts.