# evn

> Manage events

Latest version **0.0.1** (published 2016-08-16) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install evn
pnpm add evn
yarn add evn
bun add evn
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2016-08-16 |
| First published | 2016-08-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Josemi Juanes |
| Maintainers | jmjuanes |
| Keywords | events, evn, eventbus |

## Links

- npm: https://www.npmjs.com/package/evn
- Repository: https://github.com/jmjuanes/evn
- Issues: https://github.com/jmjuanes/evn/issues
- npm.io page: https://npm.io/package/evn

## 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) — 2016-08-16

## README

# evn

> Manage events in JavaScript

[![npm](https://img.shields.io/npm/v/evn.svg?style=flat-square)](https://www.npmjs.com/package/evn)
[![npm](https://img.shields.io/npm/dt/evn.svg?style=flat-square)](https://www.npmjs.com/package/evn)

## Installation

```
npm install --save evn
```

## API

### evn.add(id, callback, scope)

Add a new event listener.

#### id

A `string` withe the event ID.

#### callback

The function that will be executed when the event is executed.

#### scope

The value of `this` where the `callback` will be executed.

### evn.send(id[, args])

Emit an event.

#### id

The event ID that will be executed.

#### args (optionally)

Arguments for the callback.

## Example

```javascript
//Import dependencies
var evn = require('evn');

//Add a new event
evn.add('say_hello', function(name){ console.log('Hello ' + name + '!!'); });

//Call the event
evn.send('say_hello', 'Susan'); // -> Hello Susan!!
```

## License

&copy; [MIT LICENSE](./LICENSE)

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