# component-event

> Event binding component

Latest version **0.2.1** (published 2022-12-29) · MIT license · 0 weekly downloads

## Install

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

## 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.2.1 |
| Published | 2022-12-29 |
| First published | 2014-02-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 36 |
| Maintainers | coreh, swatinem, timaschew, anthonyshort, ianstormtaylor, nami-doc, clintwood, cristiandouce, stagas, rauchg, kelonye, amasad, trevorgerhardt, juliangruber, thehydroimpulse, dominicbarnes, dfcreative, mattmueller, tootallnate, yields, stephenmathieson, retrofox, tjholowaychuk, hughsk, jonathanong, jongleberry, forbeslindesay, calvinfo, defunctzombie |
| Keywords | browser, event, events |

## Links

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

## 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) — 2022-12-29
- 0.2.0 — 2016-09-22
- 0.1.4 — 2014-05-28
- 0.1.3 — 2014-02-10

## README

# event

  Element event binding component.

## Installation

    $ component install component/event

## Example

```js
var events = require('event');
var a = document.querySelector('a');

function onclick(e) {
  e.preventDefault();
  console.log(e.target);
  events.unbind(a, 'click', onclick);
}

events.bind(a, 'click', onclick);
```

## API

### .bind(el, type, callback, [capture])

  Bind to `el`'s event `type` with `callback`,
  returns the `callback` passed.

### .unbind(el, type, callback, [capture])

  Unbind `el`'s event `type` `callback`,
  returns the `callback` passed.

## License

  MIT

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