{"id":24278580,"url":"https://github.com/yamalight/microcore","last_synced_at":"2025-06-27T14:06:23.794Z","repository":{"id":141735748,"uuid":"103524898","full_name":"yamalight/microcore","owner":"yamalight","description":"Core library for simple creation of pipelinening microservices in Node.js with RabbitMQ","archived":false,"fork":false,"pushed_at":"2018-10-01T16:06:35.000Z","size":47,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-25T14:00:06.299Z","etag":null,"topics":["data-processing","job-queue","microservices","nodejs","pipeline","rabbitmq"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yamalight.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2017-09-14T11:36:18.000Z","updated_at":"2023-03-10T10:17:55.000Z","dependencies_parsed_at":"2024-07-16T23:36:07.592Z","dependency_job_id":null,"html_url":"https://github.com/yamalight/microcore","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/yamalight/microcore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamalight%2Fmicrocore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamalight%2Fmicrocore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamalight%2Fmicrocore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamalight%2Fmicrocore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yamalight","download_url":"https://codeload.github.com/yamalight/microcore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yamalight%2Fmicrocore/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262270428,"owners_count":23285164,"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":["data-processing","job-queue","microservices","nodejs","pipeline","rabbitmq"],"created_at":"2025-01-16T00:49:16.014Z","updated_at":"2025-06-27T14:06:23.787Z","avatar_url":"https://github.com/yamalight.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Microcore.js\n\n[![npm](https://img.shields.io/npm/v/microcore.svg)](https://www.npmjs.com/package/microcore)\n[![MIT](https://img.shields.io/npm/l/microcore.svg)](http://opensource.org/licenses/MIT)\n[![Build Status](https://travis-ci.org/yamalight/microcore.svg?branch=master)](https://travis-ci.org/yamalight/microcore)\n[![Coverage Status](https://coveralls.io/repos/github/yamalight/microcore/badge.svg?branch=master)](https://coveralls.io/github/yamalight/microcore?branch=master)\n\nMicrocore.js is a library for simple creation of pipelinening microservices in Node.js with RabbitMQ.\n\n# Installation\n\n```sh\nnpm install --save microcore\n```\n\n# Requirements\n\nSince Microcore.js is written in ES6 and it uses async/await - it requires latest stable node (7.x or later).\n\n# Features\n\n- Simple interface for building pipelinening (micro)services\n- Easy way to scale services both horizontally (by adding more nodes) and vertically (by adding more subscribers)\n\n# Usage\n\n## Quick start\n\nExample service that subscribe to messages from `helloworld` topic and does some work with incoming data (in this case it just appends `world!` to incoming string):\n\n```js\nconst createService = require('microcore');\n\n// service config\nconst serviceConfig = {\n  ID: 'helloworld',\n  type: 'servicetype',\n  rabbit: {host: 'rabbit', exchange: 'exchange'},\n  statusReportInterval: 60000,\n  resultKey: 'responsekey',\n};\n\n// creating service will return shutdown function\nconst shutdown = await createService({\n  config: serviceConfig,\n  onInit() {\n    // triggered on service init\n    console.log('Hello world service started!');\n  },\n  onJob(data, done) {\n    // triggered on incoming data to process.\n    // do your work here..\n    const resultData = `${data} world!`;\n    // call `done(err, result)` after doing the work with data\n    // result will be sent to `resultKey`\n    done(err, resultData);\n    // alternatively you can specify responseKey, e.g.:\n    // done(err, resultData, responseKey);\n  },\n  onCleanup() {\n    // triggered before service cleanup\n    console.log('Hello world service stopping!');\n  },\n});\n```\n\nExample service that sends messages to `helloworld` and logs response to console:\n\n```js\nconst Microwork = require('microwork');\n\n// create master\nconst master = new Microwork({host: 'rabbit', exchange: 'exchange'});\n// listen for reply from workers\nawait master.subscribe('responsekey', msg =\u003e {\n  console.log(msg); // -\u003e \"hello world!\"\n});\n// send message to workers\nawait master.send('helloworld', 'hello');\n```\n\n## License\n\n[MIT](http://www.opensource.org/licenses/mit-license)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyamalight%2Fmicrocore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyamalight%2Fmicrocore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyamalight%2Fmicrocore/lists"}