{"id":18563125,"url":"https://github.com/compulim/event-target-shim-es5","last_synced_at":"2025-07-25T20:40:27.558Z","repository":{"id":36710242,"uuid":"229810972","full_name":"compulim/event-target-shim-es5","owner":"compulim","description":"ES5 wrapper for event-target-shim","archived":false,"fork":false,"pushed_at":"2023-03-04T05:30:34.000Z","size":448,"stargazers_count":2,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T16:02:54.372Z","etag":null,"topics":["es5","event","event-target","html"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/event-target-shim","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/compulim.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-23T19:26:08.000Z","updated_at":"2022-03-01T08:14:51.000Z","dependencies_parsed_at":"2024-06-19T03:53:01.661Z","dependency_job_id":"e7de4518-ed2b-483b-b459-2e340b9e37ce","html_url":"https://github.com/compulim/event-target-shim-es5","commit_stats":{"total_commits":55,"total_committers":2,"mean_commits":27.5,"dds":"0.18181818181818177","last_synced_commit":"d647b910afbdcc49ba63fd4a075bdd7c590d5fcc"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Fevent-target-shim-es5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Fevent-target-shim-es5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Fevent-target-shim-es5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compulim%2Fevent-target-shim-es5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compulim","download_url":"https://codeload.github.com/compulim/event-target-shim-es5/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248151328,"owners_count":21056071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["es5","event","event-target","html"],"created_at":"2024-11-06T22:11:52.479Z","updated_at":"2025-04-10T03:32:31.588Z","avatar_url":"https://github.com/compulim.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# event-target-shim-es5\n\n[![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)\n\nThis package is based on [`event-target-shim`](https://npmjs.com/package/event-target-shim). Although the original package contains an [ES5 bundle](https://unpkg.com/event-target-shim/dist/event-target-shim.umd.js), it did not contains an ES5 module. Importing the module directly or indirectly may break web apps running on ES5 browsers.\n\nOn install, this package will transpile your version of `event-target-shim` to make it compatible with ES5 browsers.\n\nPackage authors should consider importing this package instead of `event-target-shim`, so your packages will not break your users due to having `event-target-shim` as a transient dependency.\n\n## How to use\n\nTo install in your project, run:\n\n```sh\nnpm install event-target-shim event-target-shim-es5\n```\n\nIn your code:\n\n```js\nimport EventTarget, { defineEventAttribute } from 'event-target-shim-es5';\n\nclass YourComponent extends EventTarget {\n  handleClick() {\n    this.dispatchEvent(new Event('click'));\n  }\n}\n\ndefineEventAttribute(YourComponent.prototype, 'click');\n```\n\n## How it works\n\nOn `postinstall`, this package will run Babel and Webpack to transpile `event-target-shim` into a single file.\n\nThis package peer-depends on `event-target-shim`. Thus, you can select your own version of `event-target-shim`.\n\n### Updating `event-target-shim`\n\nWhen you update `event-target-shim`, re-run `npm install event-target-shim-es5` to get the latest package transpiled.\n\n## Alternatives\n\nInstead of importing this package, there are alternative workarounds you can use.\n\n### Including the source code\n\nYou can copy the source code of `event-target-shim` into your web app and use your build pipeline transpile the original package.\n\nWhen copying, be sure to include the original license and continue to depends on the package to make sure `npm audit` will scan for vulnerabilities.\n\n### Modify your bundler configuration\n\nWebpack do not transpile code under `/node_modules/` unless specified explicitly. You can modify `webpack.config.js` to include `/node_modules/event-target-shim/` and use `babel-loader` to transpile it on-the-fly.\n\n## Contributions\n\nLike us? [Star](https://github.com/compulim/event-target-shim-es5/stargazers) us.\n\nWant to make it better? [File](https://github.com/compulim/event-target-shim-es5/issues) us an issue.\n\nDon't like something you see? [Submit](https://github.com/compulim/event-target-shim-es5/pulls) a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompulim%2Fevent-target-shim-es5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompulim%2Fevent-target-shim-es5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompulim%2Fevent-target-shim-es5/lists"}