{"name":"@whatwg-node/events","version":"0.0.3-rc-20230421122208-20ceace","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","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","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","readmeFilename":"README.md","gitHead":"20ceace5050730b4d12a45ad6f2425ad8168467d","bugs":{"url":"https://github.com/ardatan/whatwg-node/issues"},"homepage":"https://github.com/ardatan/whatwg-node#readme","_id":"@whatwg-node/events@0.0.3-rc-20230421122208-20ceace","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-IPbwDTJ8+3u+gRIP0LZMzJz7SMnWQahV2oLpAekH/AXseIRwWaEJjB5wCgNZGJQyHKXiyMmGsw35f9/MV0c1yQ==","shasum":"ef361e873a577805c1f4193ed9ae6ed1ed323f85","tarball":"http://registry-npm.ywwl.com/@whatwg-node/events/download/@whatwg-node/events-0.0.3-rc-20230421122208-20ceace.tgz","fileCount":8,"unpackedSize":8065,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbWtuydbAgXTA7j3Q4ZLw7UnsZPVLA9NfC5hjjZdK6uAIgPxyEKG/2Ks5MNltjJ94q1NptxwI4Xx4H/KCcNc5S7O0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQoAOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpcWA/5AW4CH1y/Xf8t39u0tUiOAC6Tzvworf0sjOtPlOaGdaIsRcO5\r\ntPJ46+WGt5O+TExEsFYcHaCRLnO4/KrHbgMR+j7Kj/R5vA3jRyui6kh8+Adj\r\n1HH5xmYqBTML7JIURHzjBHEKDKn+wuwdxMXBeNVd8AUmGULAl9bUGnzN6dwv\r\nd5IUkaijFAoT2IU06Dw5IB3WxhUxcbbRGigytVJxyjhunwlVtJ/ho8SaNYmG\r\n3x1XsdUDC+Ji9ssEaoPsYOIod+ZwkA/IPFigcpEJ2xw1kUUlFY+liNW7dqa5\r\nkIAXBYQJhQbQoMfeD2ZLq9eFKJbMMi/8oVIYGf2/Y1i3jaoDAlhzdvr4ubM+\r\nNlF4HAgPF/2NGEZr5gQEQADoLRRAiH8OmZZdwXqdfexvkv6s1/keQTy/Tl0k\r\nApJ8ipk/EbDHtLZjLpmWUKfVHLE3YTfZA+7hSBrvjT4YjxEN8+ZgzkqlkbR5\r\nPmy33byoAAVVBl9YicrlEF2F2Hg7xDSVlqaOMNmst95yXyCWofbL7V25pUoD\r\n7cXvkVt6wfHng/ClhA75YVqGCVeJwDuTwE5xJ3eoJc53hsKykTxLAGZJlL8o\r\nPDVWIvyTa8rDOPQQzza0xdjk5EWJ8rDK9vWbACFTOj+OmwI6/jYTKm3nXI0K\r\nI6f4dhXPlm5x5nNsU3a026P5//rrmr95PvE=\r\n=GmZe\r\n-----END PGP SIGNATURE-----\r\n","size":2684,"noattachment":false,"key":"/@whatwg-node/events/-/@whatwg-node/events-0.0.3-rc-20230421122208-20ceace.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.0.3-rc-20230421122208-20ceace_1682079758061_0.04922571719082147"},"_hasShrinkwrap":false,"publish_time":1682079758248,"_cnpm_publish_time":1682079758248,"dist-tags":{"alpha":"0.2.0-alpha-20260921120829-953be1ba805992730bb868e06f5473882a24b2e8","latest":"0.1.2","rc":"0.1.2-rc-20240729093557-94eba750aa6126090cf8d833ab33eb8e70699369"}}