# event-listener-with-options

> Polyfill for EventTarget options object support

Latest version **1.1.0** (published 2018-09-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install event-listener-with-options
pnpm add event-listener-with-options
yarn add event-listener-with-options
bun add event-listener-with-options
```

## 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.1.0 |
| Published | 2018-09-26 |
| First published | 2016-05-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 17.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Chris Cowan |
| Maintainers | agentme |
| Keywords | addEventListener, removeEventListener, EventTarget, polyfill |

## Links

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

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

- 1.1.0 (latest) — 2018-09-26
- 1.0.4 — 2018-06-04
- 1.0.3 — 2017-07-07
- 1.0.2 — 2016-05-11
- 1.0.1 — 2016-05-11
- 1.0.0 — 2016-05-11

## README

# event-listener-with-options

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Macil/event-listener-with-options/blob/master/LICENSE.txt) [![npm version](https://img.shields.io/npm/v/event-listener-with-options.svg?style=flat)](https://www.npmjs.com/package/event-listener-with-options) [![CircleCI Status](https://circleci.com/gh/Macil/event-listener-with-options.svg?style=shield)](https://circleci.com/gh/Macil/event-listener-with-options) [![Greenkeeper badge](https://badges.greenkeeper.io/Macil/event-listener-with-options.svg)](https://greenkeeper.io/)

This module exports two functions:
* `addEventListener(target, type, handler, options)`
* `removeEventListener(target, type, handler, options)`

These work like `target.addEventListener(type, handler, options)`, except that
`options` is allowed to be an object even in browsers which don't yet support
that. In that case, only the options object's `capture` property is respected.

See https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md for
more information on the options parameter.

This module also includes an optional polyfill. Use the following to override
the addEventListener and removeEventListener methods on all EventTargets with
replacements that support an options object if necessary:

```js
require('add-event-listener-with-options/js/polyfill');
```

## Types

Both [TypeScript](https://www.typescriptlang.org/) and
[Flow](https://flowtype.org/) type definitions for this module are included!
The type definitions won't require any configuration to use.

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