JSPM

@worker-tools/event-target-polyfill

0.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q44665F
  • License MIT

An EventTarget Polyfill

Package Exports

  • @worker-tools/event-target-polyfill

Readme

Event Target Polyfill

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

Usage

import '@worker-tools/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.