# listen-once

> Will add an event listener that will only fire the first time.

Latest version **2.2.0** (published 2016-08-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install listen-once
pnpm add listen-once
yarn add listen-once
bun add listen-once
```

## 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 | 2.2.0 |
| Published | 2016-08-10 |
| First published | 2016-03-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | greglarrenaga |

## Links

- npm: https://www.npmjs.com/package/listen-once
- npm.io page: https://npm.io/package/listen-once

## Recent versions

- 2.2.0 (latest) — 2016-08-10
- 2.1.0 — 2016-05-24
- 2.0.0 — 2016-03-30
- 1.0.0 — 2016-03-30

## README

## Listen Once

Will add an event listener that will only fire the first time.

Install is like:

```javascript
npm install --save listen-once
```

Use it like:

```javascript

listenOnce(element, eventName, handler, capture);

```

It can even take a array of event names to listen to and will only fire the handler on the first one. useful if you want to intentionally create a race condition.

```javascript

listenOnce(element, ['mouse', 'key', 'earthquake'], handler);

```

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