{"id":15585646,"url":"https://github.com/icebob/moleculer-sidecar-hemera","last_synced_at":"2025-03-29T08:45:44.081Z","repository":{"id":142600599,"uuid":"127279475","full_name":"icebob/moleculer-sidecar-hemera","owner":"icebob","description":"Moleculer \u003c-\u003e Hemera sidecar/gateway","archived":false,"fork":false,"pushed_at":"2018-03-29T19:24:25.000Z","size":77,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-03T23:34:59.760Z","etag":null,"topics":["hemera","microservices","moleculer","sidecar"],"latest_commit_sha":null,"homepage":"http://moleculer.services/","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/icebob.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-29T11:02:28.000Z","updated_at":"2019-01-16T15:04:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8f79e48-4183-44d9-b753-a99e4a219a05","html_url":"https://github.com/icebob/moleculer-sidecar-hemera","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icebob%2Fmoleculer-sidecar-hemera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icebob%2Fmoleculer-sidecar-hemera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icebob%2Fmoleculer-sidecar-hemera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icebob%2Fmoleculer-sidecar-hemera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icebob","download_url":"https://codeload.github.com/icebob/moleculer-sidecar-hemera/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246162115,"owners_count":20733355,"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":["hemera","microservices","moleculer","sidecar"],"created_at":"2024-10-02T21:02:19.861Z","updated_at":"2025-03-29T08:45:44.071Z","avatar_url":"https://github.com/icebob.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# moleculer-sidecar-hemera [![NPM version](https://img.shields.io/npm/v/moleculer-sidecar-hemera.svg)](https://www.npmjs.com/package/moleculer-sidecar-hemera)\n\n[Moleculer](http://moleculer.services/) \u003c-\u003e [Hemera](https://hemerajs.github.io/hemera/) sidecar/gateway.\n\n## Features\n- call Hemera service from Moleculer service\n- call Moleculer service from Hemera service\n- emit Moleculer event from Hemera service\n- broadcast Moleculer event from Hemera service\n\n## Install\n```\nnpm install moleculer-sidecar-hemera\n```\n\n## Usage\n\n### Moleculer side\n\n**Call a Hemera service**\n\n```js\nbroker.call(\"hemera.act\", { topic: \"math\", cmd: \"add\", a: 5, b: 3 })\n    .then(res =\u003e broker.logger.info(\"Result: \", res))\n    .catch(err =\u003e broker.logger.error(err));\n\n```\n\n### Hemera side\n\n**Call a Moleculer service**\n\n```js\nhemera.act({\n    topic: \"moleculer\",\n    cmd: \"call\",\n    action: \"greeter.welcome\",\n    params: {\n        name: \"John\"\n    }\n}).then(msg =\u003e hemera.log.info(\"Result: \", msg.data))\n.catch(err =\u003e hemera.log.error(err));\n```\n\n**Emit a Moleculer event**\n\n```js\nhemera.act({\n    topic: \"moleculer\",\n    cmd: \"emit\",\n    event: \"user.created\",\n    payload: {\n        id: 5,\n        name: \"John\"\n    }\n    // groups: []\n}).catch(err =\u003e hemera.log.error(err));\n```\n\n**Broadcast a Moleculer event**\n\n```js\nhemera.act({\n    topic: \"moleculer\",\n    cmd: \"broadcast\",\n    event: \"user.created\",\n    payload: {\n        id: 5,\n        name: \"John\"\n    }\n    // groups: []\n}).catch(err =\u003e hemera.log.error(err));\n```\n\n## Settings\n\n| Property | Type | Default | Description |\n| -------- | ---- | ------- | ----------- |\n| `natsOptions` | `Object` | `undefined` | NATS `connect` options for Hemera. |\n| `hemeraOptions` | `Object` | `{}` | Hemera constructor options. |\n\n\n## Test\n```\n$ npm test\n```\n\nIn development with watching\n\n```\n$ npm run ci\n```\n\n## Contribution\nPlease send pull requests improving the usage and fixing bugs, improving documentation and providing better examples, or providing some testing, because these things are important.\n\n## License\nThe project is available under the [MIT license](https://tldrlegal.com/license/mit-license).\n\n## Contact\nCopyright (c) 2018 MoleculerJS\n\n[![@icebob](https://img.shields.io/badge/github-moleculerjs-green.svg)](https://github.com/moleculerjs) [![@icebob](https://img.shields.io/badge/twitter-Icebobcsi-blue.svg)](https://twitter.com/Icebobcsi)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficebob%2Fmoleculer-sidecar-hemera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficebob%2Fmoleculer-sidecar-hemera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficebob%2Fmoleculer-sidecar-hemera/lists"}