# minivents

> Tiny eventing for javascript

Latest version **2.2.1** (published 2022-03-29) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.1 |
| Published | 2022-03-29 |
| First published | 2013-09-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 15.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 413 |
| Author | Fabien O'Carroll - allouis |
| Maintainers | allouis |
| Keywords | events, minivents, tiny, event, emitter, eventemitter |

## Links

- npm: https://www.npmjs.com/package/minivents
- Repository: https://github.com/allouis/minivents
- Homepage: https://github.com/allouis/minivents#readme
- Issues: https://github.com/allouis/minivents/issues
- npm.io page: https://npm.io/package/minivents

## 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

- 2.2.1 (latest) — 2022-03-29
- 2.2.0 — 2017-07-28
- 2.1.0 — 2017-05-02
- 2.0.2 — 2016-05-23
- 2.0.1 — 2015-12-17
- 2.0.0 — 2015-09-11
- 1.1.7 — 2014-12-05
- 1.1.6 — 2014-08-20
- 1.1.5 — 2014-07-29
- 1.1.4 — 2014-07-10
- 1.1.3 — 2014-07-10
- 1.1.2 — 2014-05-23
- 1.2.0 — 2014-02-26
- 1.1.1 — 2013-12-24
- 1.1.0 — 2013-12-20
- … 2 more at https://npm.io/package/minivents/versions

## README

# minivents [![Build Status](https://travis-ci.org/allouis/minivents.svg?branch=master)](https://travis-ci.org/allouis/minivents)

http://allouis.github.io/minivents/

# API

`on` : Listen to event. Params { type:`String`, callback:`Function` | context:`Object` }. Returns `target`.
    
`off` : Stop listening to event. Params { type:`String` | callback:`Function` }. Returns `target`.
    
`emit`: Emit event. Params { type:`String` | data:`Object` }. Returns `target`.
    
# Constructor Example
```javascript
var sandbox = new Events();
    
sandbox.on("event", function(){
    // do stuff
});

sandbox.emit("event"); //does stuff

sandbox.off("event");

sandbox.emit("event"); //does not do stuff
```    
# Mixin Example
```javascript
var sandbox = {
    otherStuff: true
};

Events(sandbox);

sandbox.on("event", function(){
    // do stuff
});

sandbox.emit("event"); //does stuff

sandbox.off("event");

sandbox.emit("event"); //does not do stuff
```

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