{"id":13452023,"url":"https://github.com/moleculerjs/moleculer","last_synced_at":"2026-10-18T23:10:21.611Z","repository":{"id":37432445,"uuid":"82289483","full_name":"moleculerjs/moleculer","owner":"moleculerjs","description":":rocket: Progressive microservices framework for Node.js","archived":false,"fork":false,"pushed_at":"2026-09-07T18:57:52.000Z","size":28973,"stargazers_count":6378,"open_issues_count":75,"forks_count":604,"subscribers_count":122,"default_branch":"master","last_synced_at":"2026-09-30T21:16:06.178Z","etag":null,"topics":["distributed-systems","microservice","microservice-framework","microservices","moleculer","nodejs"],"latest_commit_sha":null,"homepage":"https://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/moleculerjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"claude":"CLAUDE.md","gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null},"funding":{"patreon":"moleculer","open_collective":"moleculer","tidelift":"npm/moleculer","github":"moleculerjs"}},"created_at":"2017-02-17T11:11:35.000Z","updated_at":"2026-09-30T12:32:55.000Z","dependencies_parsed_at":"2026-09-28T02:43:30.474Z","dependency_job_id":null,"html_url":"https://github.com/moleculerjs/moleculer","commit_stats":{"total_commits":3648,"total_committers":154,"mean_commits":23.68831168831169,"dds":"0.22642543859649122","last_synced_commit":"6a5c249e73b6d29026a8d3418eccfde3849e7e26"},"previous_names":["ice-services/moleculer"],"tags_count":125,"template":false,"template_full_name":null,"purl":"pkg:github/moleculerjs/moleculer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moleculerjs%2Fmoleculer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moleculerjs%2Fmoleculer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moleculerjs%2Fmoleculer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moleculerjs%2Fmoleculer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moleculerjs","download_url":"https://codeload.github.com/moleculerjs/moleculer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moleculerjs%2Fmoleculer/sbom","scorecard":{"id":482503,"data":{"date":"2025-08-11","repo":{"name":"github.com/moleculerjs/moleculer","commit":"250c7e247b2e610665f897a60b547ee7a700b6aa"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Code-Review","score":5,"reason":"Found 6/12 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/bench.yml:1","Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/e2e.yml:1","Warn: no topLevel permission defined: .github/workflows/lint.yml:1","Warn: no topLevel permission defined: .github/workflows/notification.yml:1","Warn: no topLevel permission defined: .github/workflows/pkg-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":1,"reason":"2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"CII-Best-Practices","score":2,"reason":"badge detected: InProgress","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/bench.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/bench.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/bench.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/bench.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/bench.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/bench.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/e2e.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/e2e.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/e2e.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/e2e.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/e2e.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/e2e.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/lint.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/notification.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/notification.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pkg-publish.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/pkg-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pkg-publish.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/pkg-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pkg-publish.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/pkg-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pkg-publish.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/moleculerjs/moleculer/pkg-publish.yml/master?enable=pin","Warn: containerImage not pinned by hash: examples/docker/client/Dockerfile:1: pin your Docker image by updating node:8-alpine to node:8-alpine@sha256:38f7bf07ffd72ac612ec8c829cb20ad416518dbb679768d7733c93175453f4d4","Warn: containerImage not pinned by hash: examples/docker/worker/Dockerfile:1: pin your Docker image by updating node:8-alpine to node:8-alpine@sha256:38f7bf07ffd72ac612ec8c829cb20ad416518dbb679768d7733c93175453f4d4","Warn: npmCommand not pinned by hash: examples/docker/client/Dockerfile:10","Warn: npmCommand not pinned by hash: examples/docker/worker/Dockerfile:10","Info:   0 out of  16 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   2 containerImage dependencies pinned","Info:   5 out of   7 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"26 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-wm7h-9275-46v2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-75v8-2h7p-7m2m","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-44fp-w29j-9vj5","Warn: Project is vulnerable to: GHSA-4pg4-qvpc-4q3h","Warn: Project is vulnerable to: GHSA-g5hg-p3ph-g8qg","Warn: Project is vulnerable to: GHSA-fjgf-rc76-4x9p","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-h755-8qp9-cq85","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-pq67-2wwv-3xjx","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T16:58:34.303Z","repository_id":37432445,"created_at":"2025-08-19T16:58:34.303Z","updated_at":"2025-08-19T16:58:34.303Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344872684,"owners_count":38343411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-18T02:00:06.448Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["distributed-systems","microservice","microservice-framework","microservices","moleculer","nodejs"],"created_at":"2024-07-31T07:01:10.405Z","updated_at":"2026-10-18T23:10:21.604Z","avatar_url":"https://github.com/moleculerjs.png","language":"JavaScript","funding_links":["https://patreon.com/moleculer","https://opencollective.com/moleculer","https://tidelift.com/funding/github/npm/moleculer","https://github.com/sponsors/moleculerjs","https://tidelift.com/subscription/pkg/npm-moleculer?utm_source=npm-moleculer\u0026utm_medium=referral\u0026utm_campaign=enterprise\u0026utm_term=repo","https://tidelift.com/security","https://www.patreon.com/bePatron?u=6245171"],"categories":["Packages","JavaScript","Repository","对打造产品有帮助","nodejs","🐳 Docker \u0026 Cloud","🔧 Utilities \u0026 Miscellaneous","包"],"sub_categories":["Web frameworks","Web Frameworks","Web Development","Web 框架"],"readme":"![Moleculer logo](docs/assets/logo.png)\n\n![CI test](https://github.com/moleculerjs/moleculer/workflows/CI%20test/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/moleculerjs/moleculer/badge.svg?branch=master)](https://coveralls.io/github/moleculerjs/moleculer?branch=master)\n[![Maintainability](https://api.codeclimate.com/v1/badges/05ef990fe1ccb3e56067/maintainability)](https://codeclimate.com/github/moleculerjs/moleculer/maintainability)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/d3dbf0facae04c128054ac2047d1e117)](https://www.codacy.com/gh/moleculerjs/moleculer/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=moleculerjs/moleculer\u0026amp;utm_campaign=Badge_Grade)\n[![Known Vulnerabilities](https://snyk.io/test/github/moleculerjs/moleculer/badge.svg)](https://snyk.io/test/github/moleculerjs/moleculer)\n[![Discord chat](https://img.shields.io/discord/585148559155003392)](https://discord.gg/TSEcDRP)\n[![Gurubase](https://img.shields.io/badge/Gurubase-Ask%20Moleculer%20Guru-006BFF)](https://gurubase.io/g/moleculer)\n\n[![Downloads](https://img.shields.io/npm/dm/moleculer.svg)](https://www.npmjs.com/package/moleculer)\n[![Patreon](docs/assets/patreon.svg)][patreon]\n\n# Moleculer [![NPM version](https://img.shields.io/npm/v/moleculer.svg)](https://www.npmjs.com/package/moleculer) [![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social\u0026logo=twitter)](https://twitter.com/intent/tweet?text=Moleculer%20is%20a%20modern%20microservices%20framework%20for%20Node.js\u0026url=https://github.com/moleculerjs/moleculer\u0026via=MoleculerJS\u0026hashtags=nodejs,javascript,microservices)\n\n\nMoleculer is a fast, modern and powerful microservices framework for [Node.js](https://nodejs.org/en/). It helps you to build efficient, reliable \u0026 scalable services. Moleculer provides many features for building and managing your microservices.\n\u003c!--\n![](https://img.shields.io/badge/performance-%2B50%25-brightgreen.svg)\n![](https://img.shields.io/badge/performance-%2B5%25-green.svg)\n![](https://img.shields.io/badge/performance---10%25-yellow.svg)\n![](https://img.shields.io/badge/performance---42%25-red.svg)\n--\u003e\n\n**Website**: [https://moleculer.services](https://moleculer.services)\n\n**Documentation**: [https://moleculer.services/docs](https://moleculer.services/docs)\n\n# Why Moleculer?\n\nMoleculer gives you the distributed-systems layer as part of the framework, so you don't have to run a platform to get it:\n\n- **No orchestrator required.** Nodes find each other over the transporter (NATS, Redis, Kafka, MQTT, AMQP — or plain TCP with no broker at all). Service discovery is a built-in registry, not Consul, etcd or a service mesh.\n- **Scale by starting another process.** Every broker balances requests and events across the instances it can see (round-robin, random, CPU-usage, latency, sharding) with zero configuration.\n- **Fault tolerance is a broker option.** Timeout, retry, circuit breaker, bulkhead and fallback are configuration, not five more dependencies.\n- **The same code from one process to many.** Start as a modular monolith (`transporter: null`), split later by moving services to another process — the service code and the `broker.call()` sites stay the same.\n- **Batteries included, and pluggable.** Caching, parameter validation, metrics, tracing, serializers, loggers and middlewares all ship with it, and all of them can be swapped.\n\n\n# Top sponsors\n\n\u003ctable style=\"text-align:center;\"\u003e\u003ctr\u003e\n    \u003ctd\u003e\u003ca href=\"https://www.servereye.de/\" target=\"_blank\"\u003e\u003cimg src=\"https://www.servereye.de/wp-content/uploads/server-eye_logo2019.png\" width=\"300\" valign=\"middle\" /\u003e\u003c/a\u003e\u003c/td\u003e\n    \u003c!--td\u003e\u003ca href=\"https://sonderformat.llc/\" target=\"_blank\"\u003e\u003cimg src=\"https://sonderformat.llc/sonderformat/logo/sonderformat-wide-col.png\" width=\"300\" valign=\"middle\" /\u003e\u003c/a\u003e\u003c/td--\u003e\n\u003c/tr\u003e\u003c/table\u003e\n\n\n# What's included\n\n**Services and communication**\n- Promise-based solution (async/await compatible)\n- request-reply concept\n- support event driven architecture with balancing\n- built-in service registry \u0026 dynamic service discovery\n- load balanced requests \u0026 events (round-robin, random, cpu-usage, latency, sharding)\n- master-less architecture, all nodes are equal\n- multiple services on a node/server\n- support versioned services\n- service mixins\n- support [Streams](https://nodejs.org/docs/latest/api/stream.html)\n\n**Reliability**\n- many fault tolerance features (Circuit Breaker, Bulkhead, Retry, Timeout, Fallback)\n- built-in parameter validation with [fastest-validator](https://github.com/icebob/fastest-validator)\n- pluggable parameter validator\n- built-in caching solution (Memory, MemoryLRU, Redis)\n\n**Observability**\n- built-in metrics feature with reporters (Console, CSV, Datadog, Event, Prometheus, StatsD)\n- built-in tracing feature with exporters (Console, Datadog, Event, Jaeger, Zipkin, NewRelic)\n- pluggable loggers (Console, File, Pino, Bunyan, Winston, Debug, Datadog, Log4js)\n\n**Pluggable everything**\n- plugin/middleware system\n- pluggable transporters (TCP, NATS, MQTT, Redis, Kafka, AMQP 0.9, AMQP 1.0)\n- pluggable serializers (JSON, JSONExt, MsgPack, CBOR, Notepack)\n- official [API gateway](https://github.com/moleculerjs/moleculer-web), [Database access](https://github.com/moleculerjs/moleculer-db) and many other modules...\n\n# Installation\n```\n$ npm i moleculer\n```\nor\n```\n$ yarn add moleculer\n```\n\n# Create your first microservice\nThis example shows you how to create a small service with an `add` action which can add two numbers and how to call it.\n```js\nconst { ServiceBroker } = require(\"moleculer\");\n\n// Create a broker\nconst broker = new ServiceBroker();\n\n// Create a service\nbroker.createService({\n    name: \"math\",\n    actions: {\n        add(ctx) {\n            return Number(ctx.params.a) + Number(ctx.params.b);\n        }\n    }\n});\n\n// Start broker\nbroker.start()\n    // Call service\n    .then(() =\u003e broker.call(\"math.add\", { a: 5, b: 3 }))\n    .then(res =\u003e console.log(\"5 + 3 =\", res))\n    .catch(err =\u003e console.error(`Error occurred! ${err.message}`));\n```\n[Try it in your browser](https://codesandbox.io/s/ky5lj09jv?fontsize=14)\n\n# Scale it to another process\nThe interesting part is what happens when that service moves to its own process. Add a transporter, start the same file twice, and call it from a third process — no addresses to configure, no registry to run.\n\n```js\n// node.js — the same service, now on its own node\nconst { ServiceBroker } = require(\"moleculer\");\n\nconst broker = new ServiceBroker({\n    nodeID: process.argv[2],\n    transporter: \"nats://localhost:4222\"\n});\n\nbroker.createService({\n    name: \"math\",\n    actions: {\n        add(ctx) {\n            return { result: Number(ctx.params.a) + Number(ctx.params.b), from: broker.nodeID };\n        }\n    }\n});\n\nbroker.start();\n```\n\n```js\n// client.js — it only knows the action name\nconst { ServiceBroker } = require(\"moleculer\");\n\nconst broker = new ServiceBroker({ nodeID: \"client\", transporter: \"nats://localhost:4222\" });\n\nbroker.start()\n    .then(() =\u003e broker.waitForServices(\"math\"))\n    .then(async () =\u003e {\n        for (let i = 0; i \u003c 4; i++)\n            console.log(await broker.call(\"math.add\", { a: 5, b: 3 }));\n        await broker.stop();\n    });\n```\n\n```\n$ node node.js node-1 \u0026\n$ node node.js node-2 \u0026\n$ node client.js\n{ result: 8, from: 'node-1' }\n{ result: 8, from: 'node-2' }\n{ result: 8, from: 'node-1' }\n{ result: 8, from: 'node-2' }\n```\n\nStop one of the nodes and the calls keep working: the registry notices, and the surviving instance takes the traffic.\n\n\n# Create a Moleculer project\nUse the Moleculer CLI tool to create a new Moleculer based microservices project.\n\n1. Create a new project (named `moleculer-demo`)\n    ```bash\n    $ npx moleculer-cli -c moleculer init project moleculer-demo\n    ```\n    \n2. Open the project folder\n    ```bash\n    $ cd moleculer-demo\n    ```\n    \n3. Start the project\n    ```bash\n    $ npm run dev\n    ```\n\n4. Open the [http://localhost:3000/](http://localhost:3000/) link in your browser. It shows a welcome page that contains more information about your project \u0026 you can test the generated services.\n\n:tada: **Congratulations! Your first Moleculer-based microservices project is created. Read our [documentation](https://moleculer.services/docs) to learn more about Moleculer.**\n\n![Welcome page](docs/assets/project-welcome-page.png)\n\n\n# Examples\nThe [moleculer-examples](https://github.com/moleculerjs/moleculer-examples) repository contains runnable projects, each with its own README and a `run.sh` that reproduces the whole demo:\n\n- [Microservices without Kubernetes](https://github.com/moleculerjs/moleculer-examples/tree/master/01-microservices-without-kubernetes) — one process → many processes → scaling a copy, with a `moleculer-web` gateway and a docker-compose deployment\n- [Moleculer vs NestJS](https://github.com/moleculerjs/moleculer-examples/tree/master/02-moleculer-vs-nestjs) — the same service in both frameworks, side by side\n- [TypeScript](https://github.com/moleculerjs/moleculer-examples/tree/master/03-typescript) — shared contract file, schema style and class style, typed caller\n- [From a modular monolith to microservices](https://github.com/moleculerjs/moleculer-examples/tree/master/04-monolith-to-microservices) — extracting services in three stages\n- [Service discovery and load balancing](https://github.com/moleculerjs/moleculer-examples/tree/master/05-service-discovery-and-load-balancing) — scaling and crashes with traffic running, balancing strategies, TCP transporter\n- [Circuit breaker, retry and timeout](https://github.com/moleculerjs/moleculer-examples/tree/master/06-circuit-breaker-retry-timeout) — the fault-tolerance features against a deliberately flaky service\n- [Event-driven pub/sub](https://github.com/moleculerjs/moleculer-examples/tree/master/07-event-driven-pubsub) — emit vs broadcast, groups, the same code on NATS, Redis and Kafka, durable channels\n- [Moleculer vs gRPC vs tRPC](https://github.com/moleculerjs/moleculer-examples/tree/master/08-moleculer-vs-grpc-trpc) — an RPC protocol compared with a service layer, and how to combine them\n\nPlus two full applications: a [blog site](https://github.com/moleculerjs/moleculer-examples/tree/master/blog) and the [RealWorld](https://github.com/moleculerjs/moleculer-examples/tree/master/conduit) backend.\n\n# Official modules\nWe have many official modules for Moleculer. [Check our list!](https://moleculer.services/modules.html)\n\n# Supporting\nMoleculer is an open source project. It is free to use for your personal or commercial projects. However, developing it takes up all our free time to make it better and better on a daily basis. If you like Moleculer framework, **[please support it](https://moleculer.services/support.html)**.\n\nThank you very much!\n\n# For enterprise\n\nAvailable as part of the Tidelift Subscription.\n\nThe maintainers of moleculer and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-moleculer?utm_source=npm-moleculer\u0026utm_medium=referral\u0026utm_campaign=enterprise\u0026utm_term=repo)\n\n# Documentation\nYou can find here [the documentation](https://moleculer.services/docs).\n\n# Changelog\nSee [CHANGELOG.md](CHANGELOG.md).\n\n# Security contact information\nTo report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).\nTidelift will coordinate the fix and disclosure.\n\n# Contributions\nWe welcome you to join in the development of Moleculer. Please read our [contribution guide](http://moleculer.services/docs/contributing.html).\n\u003ca href=\"https://github.com/moleculerjs/moleculer/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/moleculer/contributors.svg?width=882\u0026button=false\" /\u003e\u003c/a\u003e\n\n## Project activity\n\n![Alt](https://repobeats.axiom.co/api/embed/f4cb6da776e9edc2d8118aff4e0c1ae9afe37896.svg \"Repobeats analytics image\")\n\n# License\nMoleculer is available under the [MIT license](https://tldrlegal.com/license/mit-license).\n\n# Contact\nCopyright (c) 2016-2026 MoleculerJS\n\n[![@moleculerjs](https://img.shields.io/badge/github-moleculerjs-green.svg)](https://github.com/moleculerjs) [![@MoleculerJS](https://img.shields.io/badge/twitter-MoleculerJS-blue.svg)](https://twitter.com/MoleculerJS)\n\n[patreon]: https://www.patreon.com/bePatron?u=6245171\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoleculerjs%2Fmoleculer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoleculerjs%2Fmoleculer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoleculerjs%2Fmoleculer/lists"}