# min-event

> Basic Event Lib

Latest version **1.3.0** (published 2016-11-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install min-event
pnpm add min-event
yarn add min-event
bun add min-event
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2016-11-01 |
| First published | 2015-03-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | chunpu |
| Maintainers | ftft1885 |

## Links

- npm: https://www.npmjs.com/package/min-event
- npm.io page: https://npm.io/package/min-event

## Dependencies (2)

- [getorset](https://npm.io/package/getorset.md) ^1.0.3
- [min-util](https://npm.io/package/min-util.md) latest

## Recent versions

- 1.3.0 (latest) — 2016-11-01
- 1.2.0 — 2015-10-28
- 1.1.1 — 2015-10-27
- 1.0.7 — 2015-03-26
- 1.0.6 — 2015-03-25
- 1.0.4 — 2015-03-25
- 1.0.3 — 2015-03-25
- 1.0.2 — 2015-03-24
- 1.0.1 — 2015-03-24
- 1.0.0 — 2015-03-24

## README

min-event
===

[![Build status][travis-image]][travis-url]
[![NPM version][npm-image]][npm-url]
[![Downloads][downloads-image]][downloads-url]
[![Dependency Status][david-image]][david-url]
[npm-image]: https://img.shields.io/npm/v/min-event.svg?style=flat-square
[npm-url]: https://npmjs.org/package/min-event
[downloads-image]: http://img.shields.io/npm/dm/min-event.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/min-event
[david-image]: http://img.shields.io/david/chunpu/min-event.svg?style=flat-square
[david-url]: https://david-dm.org/chunpu/min-event


Basic Event Lib

Installation
---

```sh
npm i min-event
```

Usage
---

```js
var Emitter = require('min-event')

var emitter = new Emitter
```

Basic event lib, if you are confused, see <example/events.js> just like the node.js style events based on `min-event`

Proto Api
---

#### on

Accept one function argument, return a object `{handler: listener}`

```js
var event = emitter.on(listener)
```


#### off

Accept one function argument, remove events filtered by filter

```js
emitter.off(filter)

// e.g.

emitter.off(function(event) {
	return event.type = 'event-type'
})
```


#### emit

Accept two function arguments, filter events and run events

```js
emitter.emit(filter, runner)

// e.g.
emiter.emit(function(event) {
	return event.type = 'mytype'
}, function(event) {
	event.handler() // run the handler, it is absent runner
})
```

License
---

[![License][license-image]][license-url]

[travis-image]: https://img.shields.io/travis/chunpu/min-event.svg?style=flat-square
[travis-url]: https://travis-ci.org/chunpu/min-event
[license-image]: http://img.shields.io/npm/l/min-event.svg?style=flat-square
[license-url]: #

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