# copy-event-attributes

> Copies event attributes from one DOM node to another

Latest version **1.0.1** (published 2016-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install copy-event-attributes
pnpm add copy-event-attributes
yarn add copy-event-attributes
bun add copy-event-attributes
```

## 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.1 |
| Published | 2016-04-24 |
| First published | 2016-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Fabien O'Carroll |
| Maintainers | allouis |
| Keywords | event, attributes, morphdom |

## Links

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

## 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.0.1 (latest) — 2016-04-24
- 1.0.0 — 2016-04-24

## README

# copy-event-attributes

This was pulled out of [yo-yo](https://github.com/maxogden/yo-yo) because I wanted the nicer [morphdom](https://github.com/patrick-steele-idem/morphdom) it provides, but without the dependency on [bel](https://github.com/shama/bel)

### usage

```javascript
var copyEvents = require('copy-event-attributes')

copyEvents(fromEl, toEl)
```

### usage with morphdom

```javascript
var copyEvents = require('copy-event-attributes')
var morphdom = require('morphdom')

morphdom(fromEl, toEl, {
  onBeforeMorphEl: copyEvents
})
```

### usage with custom events


```javascript
var copyEvents = require('copy-event-attributes')
var morphdom = require('morphdom')

function copyCustomEvents (fromEl, toEl) {
  return copyEvents(fromEl, toEl, ['onmyevent'])
}

morphdom(fromEl, toEl, {
  onBeforeMorphEl: copyCustomEvents
})
```

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