{"_id":"@eliasrrosa/event-emitter","_rev":"1-ba658a1e8be5219cb29de8db16220b68","name":"@eliasrrosa/event-emitter","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.2":{"name":"@eliasrrosa/event-emitter","version":"0.0.2","keywords":["event","emitter","observer","design","pattern"],"author":{"name":"Elias Rosa"},"license":"ISC","_id":"@eliasrrosa/event-emitter@0.0.2","maintainers":[{"name":"eliasrrosa","email":"elias_rrosa@hotmail.com"}],"homepage":"https://github.com/E-Rosa/event-emitter#readme","bugs":{"url":"https://github.com/E-Rosa/event-emitter/issues"},"dist":{"shasum":"d5b725a527d9b7ad8431df27b67224b86e00263c","tarball":"https://registry.npmjs.org/@eliasrrosa/event-emitter/-/event-emitter-0.0.2.tgz","fileCount":8,"integrity":"sha512-3O4Ew1yEWd52E+Yb5eNCZXV8VzZlIAzCd2552n/u+tzkH540XCiorIi+wMGNVavNbgmO7zipiXLRcp/UD7ppmg==","signatures":[{"sig":"MEUCIQC/S24lq9IdsQcFFGvLaO9Q54oyeizEh1u0LUssHo19FgIgaba/wqldxVrIV9xaFmEQPVTtON17EOWchvey61sCVq0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18045},"main":"dist/index.js","types":"./dist/index.d.ts","access":"public","gitHead":"b10f8db2370eb076e0ce1b23bf7b67980f75047f","scripts":{"test":"jest --watchAll"},"_npmUser":{"name":"eliasrrosa","email":"elias_rrosa@hotmail.com"},"repository":{"url":"git+ssh://git@github.com/E-Rosa/event-emitter.git","type":"git"},"_npmVersion":"9.6.3","description":"A typed, simple to use event emitter that solves the typing problems of the native EventTarget API.","directories":{},"_nodeVersion":"19.9.0","dependencies":{"uuid":"^11.1.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.6","@jest/globals":"^29.7.0"},"_npmOperationalInternal":{"tmp":"tmp/event-emitter_0.0.2_1740398800282_0.29992585810710337","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@eliasrrosa/event-emitter","version":"0.0.3","description":"A typed, simple to use event emitter that solves the typing problems of the native EventTarget API.","main":"dist/index.js","access":"public","scripts":{"test":"jest --watchAll"},"repository":{"type":"git","url":"git+ssh://git@github.com/E-Rosa/event-emitter.git"},"keywords":["event","emitter","observer","design","pattern"],"author":{"name":"Elias Rosa"},"license":"ISC","bugs":{"url":"https://github.com/E-Rosa/event-emitter/issues"},"homepage":"https://github.com/E-Rosa/event-emitter#readme","dependencies":{"uuid":"^11.1.0"},"devDependencies":{"@jest/globals":"^29.7.0","jest":"^29.7.0","ts-jest":"^29.2.6"},"types":"./dist/index.d.ts","gitHead":"b10f8db2370eb076e0ce1b23bf7b67980f75047f","_id":"@eliasrrosa/event-emitter@0.0.3","_nodeVersion":"19.9.0","_npmVersion":"9.6.3","dist":{"integrity":"sha512-Yiv3/Ye4scf8YgYHGAStqGIoMW4Ypj/uTFhNt2GhAdRldg5c8pXNQ2wZOJHgN5sVu7Uu/eck9I8ahy9PDZQ6aw==","shasum":"72914b05a2da7aaed104a885229246f9128022d9","tarball":"https://registry.npmjs.org/@eliasrrosa/event-emitter/-/event-emitter-0.0.3.tgz","fileCount":4,"unpackedSize":2571,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHVh5RNWk0CQOpdSrod/j+AJb2vTQ9BrJLi29JkX98tUAiBXPkKu1vmL/SmcfWZEEktIQ6edhB6YjVQQY9Nbx1LRBA=="}]},"_npmUser":{"name":"eliasrrosa","email":"elias_rrosa@hotmail.com"},"directories":{},"maintainers":[{"name":"eliasrrosa","email":"elias_rrosa@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/event-emitter_0.0.3_1740403591773_0.13828399703503758"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-24T12:06:40.164Z","modified":"2025-02-24T13:26:32.138Z","0.0.2":"2025-02-24T12:06:40.506Z","0.0.3":"2025-02-24T13:26:31.988Z"},"bugs":{"url":"https://github.com/E-Rosa/event-emitter/issues"},"author":{"name":"Elias Rosa"},"license":"ISC","homepage":"https://github.com/E-Rosa/event-emitter#readme","keywords":["event","emitter","observer","design","pattern"],"repository":{"type":"git","url":"git+ssh://git@github.com/E-Rosa/event-emitter.git"},"description":"A typed, simple to use event emitter that solves the typing problems of the native EventTarget API.","maintainers":[{"name":"eliasrrosa","email":"elias_rrosa@hotmail.com"}],"readme":"# Event Emitter\n\nApply the observer pattern. Add listeners and emit typed events.\n\n# Installation\n\n```\nnpm i @eliasrrosa/event-emitter@latest\n```\n\n# Usage\n\nInstantiate `new EventEmitter<EventType>()` with the event type. EventType will be the payload of the event. Add listeners with callbacks, emit events and remove listeners using the listenerId.\n\n```ts\nconst priceChangeEventEmitter = new EventEmitter<{ newPrice: number }>();\n\nconst listenerId = priceChangeEventEmitter.addListener({\n  callback: (ev) => {\n    console.log(\"New price alert! \", ev.newPrice);\n  },\n});\n\npriceChangeEventEmitter.emit({\n  payload: {\n    newPrice: 200,\n  },\n});\n\npriceChangeEventEmitter.removeListener(listenerId);\n```\n","readmeFilename":"README.md"}