{"_id":"@7pmlabs/event-bus","_rev":"1-9475f0366d51e565b1820beb5e2b008b","name":"@7pmlabs/event-bus","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.1":{"name":"@7pmlabs/event-bus","version":"0.0.1","_id":"@7pmlabs/event-bus@0.0.1","maintainers":[{"name":"ngphanducthinh","email":"ngphanducthinh@gmail.com"}],"dist":{"shasum":"515e85f06c94a02271b9aa8293ed5c62d3de9fca","tarball":"https://registry.npmjs.org/@7pmlabs/event-bus/-/event-bus-0.0.1.tgz","fileCount":8,"integrity":"sha512-xlqzh1khrBvrVlv55MFoODhUVikGFIpouAowuv9Bood+JZSbYFnh8egg9gaPpSWS/x2KeNZNOTa3ePGojrFJog==","signatures":[{"sig":"MEYCIQD/qZHfXivpjiDWDQA0ycea0J0I487brptd1WpR8RRwLQIhAPYjrRAmm+PnRktQSRBbjZv+O3MN5kDb13HwKII7iDXc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5957},"main":"./dist/index.umd.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.umd.cjs"}},"gitHead":"8179acd85a55bea6e2d724aedb2a68c6614c804b","scripts":{"dev":"vite","build":"tsc && vite build","preview":"vite preview","publish-package":"npm run build && npm publish","publish-package:public":"npm run build && npm publish --access public"},"_npmUser":{"name":"ngphanducthinh","email":"ngphanducthinh@gmail.com"},"_npmVersion":"9.6.3","description":"Lightweight native event bus in Typescipt.","directories":{},"_nodeVersion":"18.14.2","_hasShrinkwrap":false,"devDependencies":{"vite":"^3.2.3","typescript":"^4.6.4","@types/node":"^18.11.10","vite-plugin-dts":"^1.7.1"},"_npmOperationalInternal":{"tmp":"tmp/event-bus_0.0.1_1686750885614_0.9376029335230922","host":"s3://npm-registry-packages"}},"0.1.0":{"name":"@7pmlabs/event-bus","version":"0.1.0","type":"module","main":"./dist/index.umd.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.umd.cjs"}},"scripts":{"dev":"vite","build":"tsc && vite build","preview":"vite preview","publish-package":"npm run build && npm publish","publish-package:public":"npm run build && npm publish --access public"},"devDependencies":{"@types/node":"^20.9.0","typescript":"^5.2.2","vite":"^5.0.0","vite-plugin-dts":"^3.6.3"},"_id":"@7pmlabs/event-bus@0.1.0","gitHead":"fb871e8228bac2c51056634804daf1f0c7f9ef4b","description":"Lightweight native event bus in Typescipt.","_nodeVersion":"20.16.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-vnymJhkPCBctHJK/Z3JzwtdzreavnrXrmWVTP064zXik960vCpc1yICYC4w81CJsG1WXHPP8SO+XZ3uFAF9FsQ==","shasum":"bc707635c3b7d8e99938c98ca015cf68522f9736","tarball":"https://registry.npmjs.org/@7pmlabs/event-bus/-/event-bus-0.1.0.tgz","fileCount":6,"unpackedSize":4970,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAi2X+mCQz5NL2QicFUMonScY7XdZwApTg3rQ/C7uV4bAiEA9SF6W1XpSwa9O9TpRU3BwStk0hWbOVWZ3yhetkJE9zg="}]},"_npmUser":{"name":"ngphanducthinh","email":"ngphanducthinh@gmail.com"},"directories":{},"maintainers":[{"name":"ngphanducthinh","email":"ngphanducthinh@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/event-bus_0.1.0_1727704587756_0.5190026642943861"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-14T13:54:45.545Z","modified":"2024-09-30T13:56:28.138Z","0.0.1":"2023-06-14T13:54:45.780Z","0.1.0":"2024-09-30T13:56:27.940Z"},"description":"Lightweight native event bus in Typescipt.","maintainers":[{"name":"ngphanducthinh","email":"ngphanducthinh@gmail.com"}],"readme":"# 7pmlabs-event-bus\n\nLightweight native event bus in Typescipt.\n\n## Getting started\n\n```\nnpm i 7pmlabs-event-bus\n```\n\n## Usage\n\n```\nimport { EventBus } from '7pmlabs-event-bus';\n```\n\nEvent bus instance is signleton but you can give it a different name if you want to have more than one instance:\n```\nconst eventBus = EventBus.getInstance();\n```\n\nListen to a specific event:\n```\neventBus.on('MY-CUSTOM-EVENT', (e) => {});\n```\n\nListen only one time to a specific event:\n```\neventBus.once('MY-CUSTOM-EVENT', (e) => {});\n```\n\nEmit an event:\n```\neventBus.emit('MY-CUSTOM-EVENT', 'Hello world!');\n```\n\nRemove listener for a specific event:\n```\neventBus.off('MY-CUSTOM-EVENT', (e) => {});\n```","readmeFilename":"README.md"}