event-target-polyfill
An EventTarget Polyfill
Last updated a year ago by blesh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install event-target-polyfill 
SYNC missed versions from official npm registry.

npm version Node.js CI

event-target-polyfill

A polyfill for EventTarget (and Event), meant to run in older version of node or possibly IE 11, that has the most accurate set of characteristics of EventTarget that can be provided.

If you find this implementation can be improved, please submit a PR and ping me on Twitter via DM.

NOTE: If you are using Node 14 and higher, EventTarget is available directly via experimental features MDN: EventTarget

Usage

import 'event-target-polyfill';

const et = new EventTarget();

et.addEventListener('test', () => console.log('hit!'));

et.dispatchEvent(new Event('test'));

Development

This library has no dependencies. Even development dependencies. To test just run npm test. It runs a script, and if it finishes without error, the tests pass.

Current Tags

  • 0.0.4                                ...           latest (a year ago)

4 Versions

  • 0.0.4                                ...           a year ago
  • 0.0.3                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE