{"name":"@whatwg-node/events","version":"0.1.2","description":"Cross Platform Smart Event API Ponyfill","sideEffects":false,"dependencies":{"tslib":"^2.6.3"},"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":">=18.0.0"},"main":"cjs/index.js","module":"esm/index.js","typings":"typings/index.d.ts","typescript":{"definition":"typings/index.d.ts"},"type":"module","exports":{".":{"require":{"types":"./typings/index.d.cts","default":"./cjs/index.js"},"import":{"types":"./typings/index.d.ts","default":"./esm/index.js"},"default":{"types":"./typings/index.d.ts","default":"./esm/index.js"}},"./package.json":"./package.json"},"_id":"@whatwg-node/events@0.1.2","gitHead":"1a09d73416a0343ff2f8e01053edb8e9395a3e76","bugs":{"url":"https://github.com/ardatan/whatwg-node/issues"},"homepage":"https://github.com/ardatan/whatwg-node#readme","_nodeVersion":"22.5.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-ApcWxkrs1WmEMS2CaLLFUEem/49erT3sxIVjpzU5f6zmVcnijtDSrhoK2zVobOIikZJdH63jdAXOrvjf6eOUNQ==","shasum":"23f7c7ad887d7fd448e9ce3261eac9ef319ddd7c","tarball":"http://registry-npm.ywwl.com/@whatwg-node/events/download/@whatwg-node/events-0.1.2.tgz","fileCount":7,"unpackedSize":3799,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@whatwg-node%2fevents@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBX9ZVhvt4nfBzXc8AMcLvLbUTdo6T9FB9lXbkhSveDQIgUH0Q5iH7b20fZDvTRYJPUC53eowCXqwnO6try/sPyB0="}],"size":1449,"noattachment":false,"key":"/@whatwg-node/events/-/@whatwg-node/events-0.1.2.tgz"},"_npmUser":{"name":"ardatan","email":"ardatanrikulu@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/events_0.1.2_1722246941179_0.8304623466477816"},"_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":1722246941311,"maintainers":[{"name":"ardatan","email":"ardatanrikulu@gmail.com"}],"_cnpm_publish_time":1722246941311,"dist-tags":{"alpha":"0.2.0-alpha-20260921120829-953be1ba805992730bb868e06f5473882a24b2e8","latest":"0.1.2","rc":"0.1.2-rc-20240729093557-94eba750aa6126090cf8d833ab33eb8e70699369"}}