# common-emitter

> Common EventEmitter implementation for both server-side NodeJS and client-side Browser environments.

Latest version **0.0.1** (published 2012-03-14) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2012-03-14 |
| First published | 2012-03-14 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | brec-c |
| Maintainers | brec-c |
| Keywords | events, emitter, server, client |

## Links

- npm: https://www.npmjs.com/package/common-emitter
- Repository: https://github.com/brec-c/common-emitter
- Homepage: http://not-up-yet.com
- npm.io page: https://npm.io/package/common-emitter

## Dependencies (1)

- [underscore](https://npm.io/package/underscore.md)

## 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) — 2012-03-14

## README

#EventEmitter Everywhere… Excelsior!

Sorry, couldn't resist the alliteration.  One of the ironies of the emergence of NodeJS is that for all the glory it brings to Javascript it also is at odds with the place where Javascript has reigned supreme for many years, the browser.  Most of the NodeJS libraries are unavailable in the browser.  The Events module's EventEmitter was one of those features that exists NodeJS side but not in the browser.  This was mostly limiting not because the browser couldn't handle it but because writing code that could / should run everywhere needed to becareful to use common libraries.  __Common-Emitter__ is meant to help alleviate that issue. 

#Installation
npm install common-emitter

#Usage

Use exactly like you would EventEmitter.  When running in a NodeJS environment it actually just facilitates the requiring of EventEmitter.  But when running in a browser environment __Common-Emitter__ provides the common interface so you can write code that run everywhere Javascript does.

The excellent [Underscore](https://github.com/documentcloud/underscore) library is needed for the browser implementation.  This is *required* from within the __Common-Emitter__ code.  Using a server like [Proxy-Hem](https://github.com/brec-c/proxy-hem) or a server that uses [Stitch](https://github.com/sstephenson/stitch) will make it so this is a non-issue.  Otherwise, __Common-Emitter__ will check to see if '_' is in the window object so simple load the underscore script first and you should be fine.

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