moleculer-connect
v0.3.1
Published
Moleculer connect from CLI
Readme
A command-line interface for connecting to Moleculer microservices
🏠 Homepage
Usage
Requires Node.js 22+. Moleculer 0.15 uses communication protocol v5; this CLI disables transporter version checks by default so it can still connect to 0.14 clusters. Set transit.disableVersionCheck: false in your broker config if you want strict 0.15-only connections.
npm install moleculer-connect [email protected]For example, run below command to connect to a Moleculer TypeScript project:
NODE_OPTIONS='--import tsx' moleculer-connect --env --config moleculer.config.tsOptions
The CLI supports several options to customize the connection:
Options:
--version Show version number [boolean]
--help Show help [boolean]
-c, --config Load configuration from a file [string] [default: ""]
--ns Namespace [string] [default: ""]
--level Logging level [string] [default: "info"]
--id NodeID [string] [default: null]
-h, --hot Enable hot-reload [boolean] [default: false]
--serializer Serializer [string] [default: null]
--commands Custom REPL command file mask (e.g.: ./commands/*.js)
[string] [default: null]Custom command files can use CommonJS (module.exports) or an ESM default export.
Export one command object or an array of commands. .js files follow the nearest
package.json module type; .cjs and .mjs select the format explicitly.
Commands are added to existing replOptions.customCommands and legacy replCommands.
Run pnpm test to build and test both CLI formats, including custom command execution.
Pre-commit hooks
This project uses pre-commit to enforce code quality. To install the pre-commit hooks, run:
pre-commit installAuthor
👤 Dung Huynh Duc [email protected]
- Github: @jelydn
Show your support
Give a ⭐️ if this project helped you!
📝 License
Copyright © 2023 Dung Huynh Duc [email protected]. This project is MIT licensed.
