# attach-dom-events

> util to attach multiple dom events to an element

Latest version **1.0.0** (published 2014-09-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install attach-dom-events
pnpm add attach-dom-events
yarn add attach-dom-events
bun add attach-dom-events
```

## 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.0.0 |
| Published | 2014-09-11 |
| First published | 2014-09-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Matt DesLauriers |
| Maintainers | mattdesl |
| Keywords | attach, dom, events, event, multiple, many, bulk, dictionary, object, listener, listeners |

## Links

- npm: https://www.npmjs.com/package/attach-dom-events
- Repository: https://github.com/mattdesl/attach-dom-events
- Issues: https://github.com/mattdesl/attach-dom-events/issues
- npm.io page: https://npm.io/package/attach-dom-events

## Dependencies (1)

- [dom-events](https://npm.io/package/dom-events.md) ^0.1.1

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2014-09-11

## README

# attach-dom-events

[![unstable](http://badges.github.io/stability-badges/dist/unstable.svg)](http://github.com/badges/stability-badges)

Utility to attach multiple dom events to an element. Uses [dom-events](https://www.npmjs.org/package/dom-events).

```js
var attach = require('attach-dom-events')

attach(element, {
	mousemove: function(ev) {
		//..
	},
	keydown: function(ev) {
		//..
	}
})
```

## Usage

[![NPM](https://nodei.co/npm/attach-dom-events.png)](https://nodei.co/npm/attach-dom-events/)

#### ```attach(element[, events])```
#### ```attach.on(element[, events])```

Attaches the dictionary of `events` to `element`, using the keys as event names for `addEventListener`. 

The main exported method is the same as `on`.

#### ```attach.off(element[, events])```

Detaches all the given events.

#### ```attach.once(element[, events])```

Attaches all the given events using `once` instead of `on`.

## License

MIT, see [LICENSE.md](http://github.com/mattdesl/attach-dom-events/blob/master/LICENSE.md) for details.

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