Gathering detailed insights and metrics for event-target-shim
Gathering detailed insights and metrics for event-target-shim
Gathering detailed insights and metrics for event-target-shim
Gathering detailed insights and metrics for event-target-shim
event-target-shim-es5
[![npm version](https://img.shields.io/npm/v/event-target-shim-es5.svg)](https://www.npmjs.com/package/event-target-shim-es5) ![Node.js CI](https://github.com/compulim/event-target-shim-es5/workflows/Node.js%20CI/badge.svg)
@xo-union/event-target-shim
An implementation of WHATWG EventTarget interface.
object.assign
ES6 spec-compliant Object.assign shim. From https://github.com/es-shims/es6-shim
queue-microtask
fast, tiny `queueMicrotask` shim for modern engines
An implementation of WHATWG EventTarget interface, plus few extensions.
npm install event-target-shim
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
124 Stars
127 Commits
26 Forks
5 Watching
16 Branches
7 Contributors
Updated on 19 Aug 2024
TypeScript (98.68%)
JavaScript (1.32%)
Cumulative downloads
Total Downloads
Last day
-1.7%
3,974,921
Compared to previous day
Last week
2.7%
21,115,682
Compared to previous week
Last month
7%
89,337,821
Compared to previous month
Last year
42.2%
854,921,014
Compared to previous year
45
An implementation of WHATWG EventTarget
interface and WHATWG Event
interface. This implementation supports constructor, passive
, once
, and signal
.
This implementation is designed ...
Native Support Information:
Feature | IE | Edge | Firefox | Chrome | Safari | Node.js |
---|---|---|---|---|---|---|
Event constructor | ❌ | 12 | 11 | 15 | 6 | 15.4.0 |
EventTarget constructor | ❌ | 87 | 84 | 87 | 14 | 15.4.0 |
passive option | ❌ | 16 | 49 | 51 | 10 | 15.4.0 |
once option | ❌ | 16 | 50 | 55 | 10 | 15.4.0 |
signal option | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
Use npm or a compatible tool.
npm install event-target-shim
1import { EventTarget, Event } from "event-target-shim"; 2 3// constructor (was added to the standard on 8 Jul 2017) 4const myNode = new EventTarget(); 5 6// passive flag (was added to the standard on 6 Jan 2016) 7myNode.addEventListener( 8 "hello", 9 (e) => { 10 e.preventDefault(); // ignored and print warning on console. 11 }, 12 { passive: true } 13); 14 15// once flag (was added to the standard on 15 Apr 2016) 16myNode.addEventListener("hello", listener, { once: true }); 17myNode.dispatchEvent(new Event("hello")); // remove the listener after call. 18 19// signal (was added to the standard on 4 Dec 2020) 20const ac = new AbortController(); 21myNode.addEventListener("hello", listener, { signal: ac.signal }); 22ac.abort(); // remove the listener.
import {} from "event-target-shim/es5"
instead. It's a transpiled code by babel. It depends on @baebl/runtime
(^7.12.0
) package.unpkg.com
. For example, <script src="https://unpkg.com/event-target-shim@6.0.2"></script>
will define EventTargetShim
global variable.AbortController
class was added to the standard on 14 Jul 2017. If you want the shim of that, use abort-controller package.See docs/reference.md.
See GitHub releases.
Contributing is welcome ❤️
Please use GitHub issues/PRs.
npm install
installs dependencies for development.npm test
runs tests and measures code coverage.npm run watch:mocha
runs tests on each file change.No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 2/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
33 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More