0.0.1 • Published 11 years ago

context-emitter v0.0.1

Weekly downloads
3
License
-
Repository
github
Last release
11 years ago

context-emitter stable

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

Installation

npm install context-emitter

Usage

ContextEmitter = require('context-emitter')

Returns the base class for the emitter.

emitter = new ContextEmitter([ctx])

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.

emitter.ctx = context

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

0.0.1

11 years ago

0.0.0

11 years ago