Nervous Parrot Muttering
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

context-emitter

0.0.1 • Public • Published

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.

Keywords

none

install

npm i context-emitter

Downloadsweekly downloads

2

version

0.0.1

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability