{"name":"@whatwg-node/events","version":"0.1.1","description":"Cross Platform Smart Event API Ponyfill","repository":{"type":"git","url":"git+https://github.com/ardatan/whatwg-node.git","directory":"packages/events"},"author":{"name":"Arda TANRIKULU","email":"ardatanrikulu@gmail.com"},"license":"MIT","engines":{"node":">=16.0.0"},"main":"dist/node-ponyfill.js","browser":"dist/global-ponyfill.js","types":"dist/index.d.ts","publishConfig":{"access":"public"},"sideEffects":false,"bob":false,"denoify":{"index":"dist/deno-ponyfill.ts"},"react-native":"dist/global-ponyfill.js","gitHead":"59dac0f26b2d258e89071672834fecf9a68aa4ee","bugs":{"url":"https://github.com/ardatan/whatwg-node/issues"},"homepage":"https://github.com/ardatan/whatwg-node#readme","_id":"@whatwg-node/events@0.1.1","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-AyQEn5hIPV7Ze+xFoXVU3QTHXVbWPrzaOkxtENMPMuNL6VVHrp4hHfDt9nrQpjO7BgvuM95dMtkycX5M/DZR3w==","shasum":"0ca718508249419587e130da26d40e29d99b5356","tarball":"http://registry-npm.ywwl.com/@whatwg-node/events/download/@whatwg-node/events-0.1.1.tgz","fileCount":8,"unpackedSize":4468,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDl4CWnbC4410k11VfnMpFMPOt7sr4U1I7+7C2qvDDgTgIgEqekiXX3M5Hmcn2qayWIogSN9e/ih1G01AIpRMEkGDE="}],"size":1879,"noattachment":false,"key":"/@whatwg-node/events/-/@whatwg-node/events-0.1.1.tgz"},"_npmUser":{"name":"ardatan","email":"ardatanrikulu@gmail.com"},"directories":{},"maintainers":[{"name":"ardatan","email":"ardatanrikulu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/events_0.1.1_1685010841358_0.14341320194265283"},"_hasShrinkwrap":false,"readme":"# `@whatwg-node/events`\n\nA ponyfill package for JavaScript [DOM Events Standard](https://dom.spec.whatwg.org/#events). If\nyour JavaScript environment doesn't implement this standard natively, this package automatically\nponyfills the missing parts, and export them as a module.\n\n## Installation\n\n```bash\nyarn add @whatwg-node/events\n```\n\n## Usage\n\n```ts\nimport { Event, EventTarget } from '@whatwg-node/events'\n\nconst target = new EventTarget()\ntarget.addEventListener('foo', (event: Event) => {\n  console.log(event.type) // foo\n})\n\ntarget.dispatchEvent(new Event('foo'))\n```\n\n> If your environment already implements these natively, this package will export the native ones\n> automatically.\n\n## Custom Events\n\n```ts\nimport { CustomEvent, EventTarget } from '@whatwg-node/events'\n\nconst target = new EventTarget()\ntarget.addEventListener('foo', (event: CustomEvent) => {\n  console.assert(event.detail.foo, 'bar')\n})\n\n// `detail` can take any value\ntarget.dispatchEvent(new CustomEvent('foo', { detail: { foo: 'bar' } }))\n```\n\n## API\n\nThe following classes are exported by this package:\n\n- [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event)\n- [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent)\n- [EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget)\n","publish_time":1685010841578,"_cnpm_publish_time":1685010841578,"dist-tags":{"alpha":"0.2.0-alpha-20260921120829-953be1ba805992730bb868e06f5473882a24b2e8","latest":"0.1.2","rc":"0.1.2-rc-20240729093557-94eba750aa6126090cf8d833ab33eb8e70699369"}}