# context-emitter

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

Latest version **0.0.1** (published 2013-09-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install context-emitter
pnpm add context-emitter
yarn add context-emitter
bun add context-emitter
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2013-09-06 |
| First published | 2013-09-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Hugh Kennedy |
| Maintainers | hughsk |
| Keywords | events, emitter, context, set, define |

## Links

- npm: https://www.npmjs.com/package/context-emitter
- Repository: https://github.com/hughsk/context-emitter
- npm.io page: https://npm.io/package/context-emitter

## Dependencies (1)

- [inherits](https://npm.io/package/inherits.md) ~2.0.1

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.0.1 (latest) — 2013-09-06
- 0.0.0 — 2013-09-06

## README

# context-emitter [![stable](http://hughsk.github.io/stability-badges/dist/stable.svg)](http://github.com/hughsk/stability-badges) #

A simple extension of node's
[`EventEmitter`](http://nodejs.org/api/events.html) that permits setting the
context of emitted events.

## Installation ##

``` bash
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.

---
_Source: https://npm.io/package/context-emitter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
