{"id":22416384,"url":"https://github.com/cilindrox/hapi-emitter","last_synced_at":"2025-07-07T14:06:47.433Z","repository":{"id":5555548,"uuid":"53418583","full_name":"cilindrox/hapi-emitter","owner":"cilindrox","description":"A hapi EventEmitter plugin","archived":false,"fork":false,"pushed_at":"2022-04-10T05:11:34.000Z","size":385,"stargazers_count":1,"open_issues_count":7,"forks_count":4,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-22T13:09:19.952Z","etag":null,"topics":["hapi-plugin","hapijs","hapijs-plugin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cilindrox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-08T14:28:36.000Z","updated_at":"2020-11-28T06:57:43.000Z","dependencies_parsed_at":"2022-08-06T19:00:26.440Z","dependency_job_id":null,"html_url":"https://github.com/cilindrox/hapi-emitter","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/cilindrox/hapi-emitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cilindrox%2Fhapi-emitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cilindrox%2Fhapi-emitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cilindrox%2Fhapi-emitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cilindrox%2Fhapi-emitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cilindrox","download_url":"https://codeload.github.com/cilindrox/hapi-emitter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cilindrox%2Fhapi-emitter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262312625,"owners_count":23291965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hapi-plugin","hapijs","hapijs-plugin"],"created_at":"2024-12-05T15:16:05.193Z","updated_at":"2025-07-07T14:06:47.378Z","avatar_url":"https://github.com/cilindrox.png","language":"JavaScript","readme":"# hapi-emitter\nA hapi EventEmitter plugin\n\n[![CircleCI](https://circleci.com/gh/cilindrox/hapi-emitter.svg?style=svg)](https://circleci.com/gh/cilindrox/hapi-emitter)\n\n## Installation\n\n```\nnpm install --save hapi-emitter\n```\n\n## Versions\nUse v1.x.x in consumers using Hapi 16.\nUse v2.x.x in consumers using Hapi 17+.\n\n## Example\n\n```js\n'use strict';\n\nconst Hapi = require('hapi');\n\nconst server = new Hapi.Server();\nserver.connection({ host: 'localhost' });\n\n// Register the plugin\nserver.register({\n    register: require('hapi-emitter'),\n    options: {\n        name: 'events'\n    }\n}, (err) =\u003e {\n\n    if (err) {\n        console.error(err);\n    } \n    else {\n        server.start(() =\u003e {\n\n            console.info(`Server started at ${server.info.uri}`);\n        });\n    }\n});\n\n// Declare a route that uses it\n\nserver.route({\n    method: 'POST',\n    path: '/events',\n    handler: myHandler\n});\n\n\n// Access the EventEmitter instance\n\nconst myHandler = (request, reply) =\u003e {\n  \n    const events = request.server.events;\n    events.emit('hello', request.payload.world);\n\n    return reply().code(202);\n};\n\nserver.start(function() {\n    console.log(`Server started at ${server.info.uri}`);\n});\n```\n\n## Tests\n\nTo run the test suite, first install the dependencies, then run `npm test`:\n\n```bash\n$ npm install\n$ npm test\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcilindrox%2Fhapi-emitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcilindrox%2Fhapi-emitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcilindrox%2Fhapi-emitter/lists"}