# easy-events

> Simple evented systems.

Latest version **0.2.1** (published 2018-01-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install easy-events
pnpm add easy-events
yarn add easy-events
bun add easy-events
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2018-01-29 |
| First published | 2017-12-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Innectic |
| Maintainers | innectic |
| Keywords | events, evented |

## Links

- npm: https://www.npmjs.com/package/easy-events
- Repository: https://github.com/innectic/easy-events
- Homepage: https://github.com/innectic/easy-events#readme
- Issues: https://github.com/innectic/easy-events/issues
- npm.io page: https://npm.io/package/easy-events

## Dependencies (2)

- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.10
- [reflect-annotations](https://npm.io/package/reflect-annotations.md) ^2.3.0

## 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.2.1 (latest) — 2018-01-29
- 0.2.0 — 2017-12-18
- 0.1.0 — 2017-12-17

## README

# Easy Events

Creating evented systems shouldn't be hard, and it shouldn't involve EventEmitter (it kind of sucks!).

# Usage

```typescript

import { getDispatch, Event, EventController } from "easy-events";

@EventController()
class EventTest {

	@Event("cool_event")
	public async eventTest(data: string) {
		console.log(`Got a really cool event! ${data}`);
	}

	@Event("cool_event")
	@Priority(EventPriority.FIRST)
	public async anotherTest(data: string) {
		console.log(`I'm first! ${data}`);
	}
}

export class Core {

	public async start() {
		const dispatch = await getDispatch();
		await dispatch.emit("cool_event", "Woah, my event is so cool!");
	}
}
```

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