# custom-event

> Cross-browser `CustomEvent` constructor

Latest version **1.0.1** (published 2016-10-13) · MIT license · 0 weekly downloads

## Install

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

## 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-10-13 |
| First published | 2015-01-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 99 |
| Author | Nathan Rajlich |
| Maintainers | tootallnate |
| Keywords | dom, browser, event, custom, customevent, constructor |

## Links

- npm: https://www.npmjs.com/package/custom-event
- Repository: https://github.com/webmodules/custom-event
- Issues: https://github.com/webmodules/custom-event/issues
- npm.io page: https://npm.io/package/custom-event

## 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.1 (latest) — 2016-10-13
- 1.0.0 — 2015-01-07

## README

custom-event
============
### Cross-browser `CustomEvent` constructor

[![Sauce Test Status](https://saucelabs.com/browser-matrix/custom-event.svg)](https://saucelabs.com/u/custom-event)

[![Build Status](https://travis-ci.org/webmodules/custom-event.svg?branch=master)](https://travis-ci.org/webmodules/custom-event)

https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent.CustomEvent


Installation
------------

``` bash
$ npm install custom-event
```


Example
-------

``` js
var CustomEvent = require('custom-event');

// add an appropriate event listener
target.addEventListener('cat', function(e) { process(e.detail) });

// create and dispatch the event
var event = new CustomEvent('cat', {
  detail: {
    hazcheeseburger: true
  }
});
target.dispatchEvent(event);
```

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