Socket
Socket
Sign inDemoInstall

event-target-polyfill

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    event-target-polyfill

An EventTarget Polyfill


Version published
Weekly downloads
162K
decreased by-12.06%
Maintainers
1
Install size
13.4 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 06 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc