# typed-event-publisher

> An event publisher implementation that communicates based on type property.

Latest version **0.0.1** (published 2015-09-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install typed-event-publisher
pnpm add typed-event-publisher
yarn add typed-event-publisher
bun add typed-event-publisher
```

## 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 | 2015-09-21 |
| First published | 2015-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Ryo Nakamura |
| Maintainers | r7kamura |

## Links

- npm: https://www.npmjs.com/package/typed-event-publisher
- Repository: https://github.com/r7kamura/typed-event-publisher
- Issues: https://github.com/r7kamura/typed-event-publisher/issues
- npm.io page: https://npm.io/package/typed-event-publisher

## Recent versions

- 0.0.1 (latest) — 2015-09-21

## README

# typed-event-publisher
An event publisher implementation that communicates based on type property.

## Install
```sh
npm install typed-event-publisher
```

## Usage
```js
import EventPublisher from 'typed-event-publisher'

const eventPublisher = new EventPublisher();

// Subscribe all events
eventPublisher.subscribe((event) => {
  ...
});

// Subscribe foo events
eventPublisher.on('foo', (event) => {
  ...
});

eventPublisher.publish('foo');
eventPublisher.publish('bar');
eventPublisher.publish('baz', { boo });
```

### Import
Import in your favorite style.

```js
// Pattern 1: Using a default export
import EventPublisher from 'typed-event-publisher'

// Pattern 2: Using named exports
import { EventPublisher, Subscription } from 'typed-event-publisher'

// Pattern 3: Using both a default export and named exports
import EventPublisher, { Subscription } from 'typed-event-publisher'
```

## For contributors
```sh
# Set up
npm install

# Compile JavaScript files
npm run compile

# Watch changes of JavaScript files
npm run watch

# Run tests
npm run test
```

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