{"name":"eventemitter3","version":"5.0.4","description":"EventEmitter3 focuses on performance while maintaining a Node.js AND browser compatible interface.","exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"},"./package.json":"./package.json"},"main":"index.js","types":"index.d.ts","scripts":{"rollup":"rm -rf dist && rollup -c","benchmark":"find benchmarks/run -name '*.js' -exec benchmarks/start.sh {} \\;","test":"c8 --reporter=lcov --reporter=text mocha test/test.js","test-esm":"mocha test/test.mjs","prepublishOnly":"npm run rollup"},"repository":{"type":"git","url":"git://github.com/primus/eventemitter3.git"},"keywords":["EventEmitter","EventEmitter2","EventEmitter3","Events","addEventListener","addListener","emit","emits","emitter","event","once","pub/sub","publish","reactor","subscribe"],"author":{"name":"Arnout Kazemier"},"license":"MIT","bugs":{"url":"https://github.com/primus/eventemitter3/issues"},"devDependencies":{"@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-terser":"^0.4.0","assume":"^2.2.0","c8":"^10.1.3","mocha":"^11.7.5","rollup":"^4.5.2"},"gitHead":"b0144e940ace8add8f335a8adfbed9284eb419f3","_id":"eventemitter3@5.0.4","homepage":"https://github.com/primus/eventemitter3#readme","_nodeVersion":"25.3.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==","shasum":"a86d66170433712dde814707ac52b5271ceb1feb","tarball":"http://registry-npm.ywwl.com/eventemitter3/download/eventemitter3-5.0.4.tgz","fileCount":12,"unpackedSize":74386,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDhVYiYw6AnCQO9Px56druS08cIVtNEH13SqMJVLQ7WKAiEA0Fr2iomaTIwKJbgh9QBfwmXTLoQWfOuGpuju9sXutoU="}],"size":12133,"noattachment":false,"key":"/eventemitter3/-/eventemitter3-5.0.4.tgz"},"_npmUser":{"name":"lpinca","email":"luigipinca@gmail.com"},"directories":{},"maintainers":[{"name":"v1","email":"npm@3rd-Eden.com"},{"name":"lpinca","email":"luigipinca@gmail.com"},{"name":"3rdeden","email":"npmjs@3rd-Eden.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eventemitter3_5.0.4_1768835336090_0.13771163306561407"},"_hasShrinkwrap":false,"readme":"# EventEmitter3\n\n[![Version npm](https://img.shields.io/npm/v/eventemitter3.svg?style=flat-square)](https://www.npmjs.com/package/eventemitter3)[![CI](https://img.shields.io/github/actions/workflow/status/primus/eventemitter3/ci.yml?branch=master&label=CI&style=flat-square)](https://github.com/primus/eventemitter3/actions?query=workflow%3ACI+branch%3Amaster)[![Coverage Status](https://img.shields.io/coveralls/primus/eventemitter3/master.svg?style=flat-square)](https://coveralls.io/r/primus/eventemitter3?branch=master)\n\nEventEmitter3 is a high performance EventEmitter. It has been micro-optimized\nfor various of code paths making this, one of, if not the fastest EventEmitter\navailable for Node.js and browsers. The module is API compatible with the\nEventEmitter that ships by default with Node.js but there are some slight\ndifferences:\n\n- Domain support has been removed.\n- We do not `throw` an error when you emit an `error` event and nobody is\n  listening.\n- The `newListener` and `removeListener` events have been removed as they\n  are useful only in some uncommon use-cases.\n- The `setMaxListeners`, `getMaxListeners`, `prependListener` and\n  `prependOnceListener` methods are not available.\n- Support for custom context for events so there is no need to use `fn.bind`.\n- The `removeListener` method removes all matching listeners, not only the\n  first.\n\nIt's a drop in replacement for existing EventEmitters, but just faster. Free\nperformance, who wouldn't want that? The EventEmitter is written in EcmaScript 3\nso it will work in the oldest browsers and node versions that you need to\nsupport.\n\n## Installation\n\n```bash\n$ npm install --save eventemitter3\n```\n\n## CDN\n\nRecommended CDN:\n\n```text\nhttps://unpkg.com/eventemitter3@latest/dist/eventemitter3.umd.min.js\n```\n\n## Usage\n\nAfter installation the only thing you need to do is require the module:\n\n```js\nvar EventEmitter = require('eventemitter3');\n```\n\nAnd you're ready to create your own EventEmitter instances. For the API\ndocumentation, please follow the official Node.js documentation:\n\nhttp://nodejs.org/api/events.html\n\n### Contextual emits\n\nWe've upgraded the API of the `EventEmitter.on`, `EventEmitter.once` and\n`EventEmitter.removeListener` to accept an extra argument which is the `context`\nor `this` value that should be set for the emitted events. This means you no\nlonger have the overhead of an event that required `fn.bind` in order to get a\ncustom `this` value.\n\n```js\nvar EE = new EventEmitter()\n  , context = { foo: 'bar' };\n\nfunction emitted() {\n  console.log(this === context); // true\n}\n\nEE.once('event-name', emitted, context);\nEE.on('another-event', emitted, context);\nEE.removeListener('another-event', emitted, context);\n```\n\n### Tests and benchmarks\n\nTo run tests run `npm test`. To run the benchmarks run `npm run benchmark`.\n\nTests and benchmarks are not included in the npm package. If you want to play\nwith them you have to clone the GitHub repository. Note that you will have to\nrun an additional `npm i` in the benchmarks folder before `npm run benchmark`.\n\n## License\n\n[MIT](LICENSE)\n","publish_time":1768835336257,"_cnpm_publish_time":1768835336257,"dist-tags":{"latest":"5.0.4"}}