Skip to content

polyfill-event-target 1.0.2

Install from the command line:
Learn more about npm packages
$ npm install @videsk/polyfill-event-target@1.0.2
Install via package.json:
"@videsk/polyfill-event-target": "1.0.2"

About this version

npm version Node.js CI

EventTarget 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 '@videsk/polyfill-event-target';

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.

Details


Assets

  • polyfill-event-target-1.0.2.tgz

Download activity

  • Total downloads 568
  • Last 30 days 10
  • Last week 0
  • Today 0

Recent versions

View all