Skip to content

benlesh/event-target-polyfill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm version Node.js CI

NO LONGER MAINTAINED

I no longer have a reason to maintain this. Feel free to fork. If you you'd like to take it over, just DM me on Twitter and we'll work something out.

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.

About

An EventTarget Polyfill

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •