{"_id":"@botorjs/event-bus","_rev":"1-29e338f31f4d3af4032e7a2e44d44f8d","name":"@botorjs/event-bus","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@botorjs/event-bus","version":"0.0.1","description":"Library that core of Botorjs is a event bus","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"tsc","test":"mocha -r ts-node/register tests/**/*.test.ts","coverage":"nyc -r lcov -e .ts -x \"*.test.ts\" mocha -r ts-node/register tests/**/*.test.ts && nyc report","coverage-ci":"nyc -r lcov -e .ts -x \"*.test.ts\" mocha -r ts-node/register tests/**/*.test.ts && nyc report --reporter=text-lcov | coveralls"},"repository":{"type":"git","url":"git+https://github.com/botorjs/event-bus.git"},"keywords":["botor","botorjs","event-bus","event","bus","channel","point-to-point","node","typescript"],"author":{"name":"norton"},"license":"MIT","bugs":{"url":"https://github.com/botorjs/event-bus/issues"},"homepage":"https://github.com/botorjs/event-bus#readme","devDependencies":{"@types/chai":"^4.1.7","@types/debug":"^4.1.2","@types/mocha":"^5.2.6","@types/node":"^11.10.5","chai":"^4.2.0","coveralls":"^3.0.3","debug":"^4.1.1","mocha":"^6.0.2","nyc":"^13.3.0","ts-node":"^8.0.2","typescript":"^3.3.3333"},"gitHead":"9206b1b71d219489f3554fbf524b37b606994d4d","_id":"@botorjs/event-bus@0.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.2","_npmUser":{"name":"nortonperson","email":"norton0395@gmail.com"},"dist":{"integrity":"sha512-N+8FbFN64zOMrZ7fecO1j+BkLsOSfp6V22pQox7ZYkGBj7nYfWyJkYOeImCQkEYQKTAmgytvQ+dgt/f6THx7kw==","shasum":"c894f7d32bf497e3a39df3ab8dbdca19f520f36b","tarball":"https://registry.npmjs.org/@botorjs/event-bus/-/event-bus-0.0.1.tgz","fileCount":11,"unpackedSize":21761,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgl5MCRA9TVsSAnZWagAAQGkP/0gC3d9ZRIWYyKbQeb4D\nGlNfTyPfCMo7CEWmCwMgRlCMFJqIe4WZv18JJqO3jaBe5g6/lPVf4W/6jiQ/\no92hExGPHr//K4z62esNIiVP1BdhbfXpsKmxtv50z6xb8eobC+Z8zllg9t9K\n5TTuobWA+0Qc+ef+CxfTnRnBzI6YLYQ+IHjYI9w5sYtXwxtEwvw+5AjHIhST\nZsswazBuyJbYYphqK19cd40JuLwBnL35X8E/YW/nHz5rCnuJdDfDt/PvNnIS\nogyoLOAzj41YEH7qSDVzRbKIAP/u3K2GwtS5++mlMmimiYbyws52BOajcDFR\nfD4YFh782QERFyGo8JFnA8v63dcjtEjolz6EAoPvY1uRcizTDCDJMo4dFuzq\nRFCrXfjSpaZpiNTDJcgtFv/qGAIlsZhCRY3/mAPcUO7FdXHgFF4jksTKU3dA\n8mqqh8Rv6PGMMySX/QymCrIWMG8r5YVummPRANtBcsYRdItNwVackdVM3AxQ\nJb5pQopGOv8P4rv6uSu3dMr0I/e13XSCO89uFzQt0JAW/qYOAYWeHy6713Ef\nIkHAAPgaQYycaIj/bZokQkWHHiuPhZx5vufu+B4Slc37zgaPeTDRxW2r0EDB\naIeWi+LmuE1uvORnL2Vzsy6XrlsUaNrlN9XB3exS0YOijH5GR89yfJuma/vr\nPKbv\r\n=VF+Z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPj4ZqPJMJGGeEYfNm4Jg0PuLYGmZwsisH2fWqUj3vaQIhAOEfndqwNa9x2j16uII9DU1uYtKuvgUCyMf6OtTrE9Pu"}]},"maintainers":[{"name":"nortonperson","email":"norton0395@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/event-bus_0.0.1_1552047692332_0.16281483908102357"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-08T12:21:32.157Z","0.0.1":"2019-03-08T12:21:32.426Z","modified":"2022-04-04T20:14:26.269Z"},"maintainers":[{"name":"nortonperson","email":"norton0395@gmail.com"}],"description":"Library that core of Botorjs is a event bus","homepage":"https://github.com/botorjs/event-bus#readme","keywords":["botor","botorjs","event-bus","event","bus","channel","point-to-point","node","typescript"],"repository":{"type":"git","url":"git+https://github.com/botorjs/event-bus.git"},"author":{"name":"norton"},"bugs":{"url":"https://github.com/botorjs/event-bus/issues"},"license":"MIT","readme":"# Event Bus\n[![Build Status](https://travis-ci.org/botorjs/event-bus.svg?branch=master)](https://travis-ci.org/botorjs/event-bus)\n[![Coverage Status](https://coveralls.io/repos/github/botorjs/event-bus/badge.svg?branch=master)](https://coveralls.io/github/botorjs/event-bus?branch=master)\n\n### Library that core of Botorjs is a event bus\n\n# Installation\n```\nnpm install @botorjs/event-bus --save\n```\n\n# Setup and Example\n\n\n```js\n\n    import { EventBus } from \"../src/EventBus\";\n    var bus: EventBus = new EventBus();\n\n    // \n    bus.on(\"test\", function(data) {\n       // process\n    })\n    bus.emit(\"test\", \"test\");\n\n    // channel point-to-point\n    bus.registerChannel(\"test\", \"test\", (data: ContextChannel) => {\n        // process\n    });\n    bus.emit(\"test\",\"t\");\n    bus.emit(\"test\",\"t\");\n    bus.emit(\"test\",\"t\");\n```\n\n# API\n\n## EventBus\n\n| Property   |      Description      |\n|---------- |:-------------|\n| on(name, callback)  |  listen event | \n| once(name, callback) |    listen event one time  | \n| off(name, callback) | remove listen event | \n| registerChannel(name, event_name, callback, limit = 0) |  register a channel with callback handle |\n| getChannel(name)  |  get channel have register | \n| removeChannel(name)  |  remove channel have register | \n\n\n## ContextChannel\n* data connext of Channel\n\n| Property   |      Description      |\n|---------- |:-------------|\n| data  |  get value data | \n| channel |   set channel event  | \n\n## Channel\n\n| Property   |      Description      |\n|---------- |:-------------|\n| name  |  name channel |\n| listen |   listen event  |\n| remove |   remove listen event  |\n","readmeFilename":"README.md"}