{"name":"@whatwg-node/events","version":"0.0.3-alpha-20230419123610-477371a","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":"477371a7260f84b4aa6878d7547333d628bf24f5","bugs":{"url":"https://github.com/ardatan/whatwg-node/issues"},"homepage":"https://github.com/ardatan/whatwg-node#readme","_id":"@whatwg-node/events@0.0.3-alpha-20230419123610-477371a","_nodeVersion":"18.15.0","_npmVersion":"9.5.0","dist":{"integrity":"sha512-wPN1fVJJydoPbhye1QRWrME02DcSAE2LFI6bNg4bhSYTztXZ6eiLOlzSGUbDOoDwoW9SsYbs3Fv8Dw6xNQQPyg==","shasum":"3c67a0ec3e65f204cea55c3e14ffc6790bfa389d","tarball":"http://registry-npm.ywwl.com/@whatwg-node/events/download/@whatwg-node/events-0.0.3-alpha-20230419123610-477371a.tgz","fileCount":8,"unpackedSize":8071,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeX8w+iT3Jw5SLKmCy/zEwOUOvux9xPpxD1TX8ZYYB4gIhAMFAe7Qvvrmsp7R1HFcZ3X/pWuBZdZ6Re4bBbbkEsqZj"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkP+BYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqRqA/+N2fTouqdz4FZxKPTZK+vmWH1wrFp8DQeGxvRClRUDx8L6Grt\r\nCvTlR5KOfCFY2+wA8p5ZpLQQyhiJwFBSvUtFk1MM/r+oSaivWQbvzw9lIQ/F\r\n+h23UWAomhwiGJ1nYi3RyWvo7Mj2gk5sHjrVkYjS6xcDPmTvBBxPnLWqpPpk\r\nbyobMlvyBwuyMnT4lBJHLdULlm+Mx1AHyQ6GJQS22Qh4L7mSr4sv0fo8X0sZ\r\nWuPgreDUcGKpegYn1xextNHC46PUFBWiU7FihaqlvxXpI2HJf60fg3UwE1Eo\r\nDxCHcZYk8qcBskfkRIlW0uUjaCCY72QpGIZxRZq0dgRLoLdorIxljKot/BYP\r\n8WvZB5PfA1mJTv48opPuhMYVSK+Vxj14q2Q7DSgUpin3NOwFAWDGgUyGLI/b\r\n1DBkmGLXNQDfWc9oDg5x1f7VnkGyUpMfpIdCy/57PR64hta5ioAeulqW9yxu\r\nePAPHPuv2deKO6f/8Q5z6wzP/vJ0NHm6cYnFwZzelErvexHVup3bY77Gc4Xk\r\nQKKTebsMDdQ0tMy26bPLPI3bK4o4rrI39MFIVvyCzUIlSNmDfVwXmabtc2oC\r\nSICBvPbCeymVPl6BAzPeGu3+khZS+rmuKE0slWbqsTAul2acHQRO3lLKC70A\r\nh80yIT4fvONhy/UDUeG3WF3wLfcjt1vvEjg=\r\n=hg8V\r\n-----END PGP SIGNATURE-----\r\n","size":2692,"noattachment":false,"key":"/@whatwg-node/events/-/@whatwg-node/events-0.0.3-alpha-20230419123610-477371a.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-alpha-20230419123610-477371a_1681907800455_0.0018670270151146529"},"_hasShrinkwrap":false,"publish_time":1681907800607,"_cnpm_publish_time":1681907800607,"dist-tags":{"alpha":"0.2.0-alpha-20260921120829-953be1ba805992730bb868e06f5473882a24b2e8","latest":"0.1.2","rc":"0.1.2-rc-20240729093557-94eba750aa6126090cf8d833ab33eb8e70699369"}}