npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

moleculer-repl

v0.8.0

Published

REPL module for Moleculer

Readme

Moleculer logo

REPL module for Moleculer NPM version

The moleculer-repl is an interactive developer console for Moleculer microservices framework.

Features

  • List nodes, services, actions and events
  • Call actions with parameters, meta and streaming support
  • Direct call actions on specific nodes
  • Emit and broadcast events
  • Benchmark actions
  • Cache management (list keys, clear)
  • Load services from file or folder
  • Listen to events in real-time
  • Show local node information & configuration
  • Show metrics
  • Custom commands support
  • Command history (persisted across sessions)
  • Autocomplete for action names, event names and node IDs

Requirements

  • Node.js >= 22
  • Moleculer >= 0.14.12 (0.15.0 compatible)

Install

npm install moleculer-repl

Usage

Start broker in REPL mode

const { ServiceBroker } = require("moleculer");

const broker = new ServiceBroker();

broker.start().then(() => {
    broker.repl();
});

You will get a console:

mol $

Run help to see available commands.

Custom delimiter

// moleculer.config.js
module.exports = {
    replOptions: {
        delimiter: "moleculer λ"
    }
};

Custom commands

// moleculer.config.js
module.exports = {
    replOptions: {
        customCommands: [
            {
                command: "hello <name>",
                description: "Call the greeter.hello service with name",
                alias: "hi",
                options: [
                    { option: "-u, --uppercase", description: "Uppercase the name" }
                ],
                action(broker, args, helpers) {
                    const name = args.options.uppercase ? args.name.toUpperCase() : args.name;
                    return broker.call("greeter.hello", { name }).then(console.log);
                }
            }
        ]
    }
};

Commands

call <actionName> [jsonParams] [meta]

Call an action. Supports JSON params, key-value flags, meta, streaming and file I/O.

# Call with JSON params
mol $ call greeter.hello {"name":"World"}

# Call with key-value params
mol $ call greeter.hello --name World

# Call with meta (use # prefix)
mol $ call greeter.echo --a 5 --#b 3

# Call with calling options (use $ prefix)
mol $ call greeter.hello --name World --$timeout 3000

# Load params from file
mol $ call greeter.hello --load

# Load params, meta and options from file
mol $ call greeter.hello --loadFull params.json

# Send a file as stream
mol $ call file.save --stream ./data.bin

# Save response to file
mol $ call greeter.hello --save response.json

# Save streaming response to stdout
mol $ call greeter.objectStream --save stdout

dcall <nodeID> <actionName> [jsonParams] [meta]

Direct call an action on a specific node. Same options as call.

emit <eventName> [jsonParams]

Emit an event.

mol $ emit user.created {"name":"John"}

broadcast <eventName> [jsonParams]

Broadcast an event to all nodes.

mol $ broadcast config.changed

bench <actionName> [jsonParams] [meta]

Benchmark an action.

# Run for 5 seconds (default)
mol $ bench greeter.hello {"name":"World"}

# Run specific number of iterations
mol $ bench greeter.hello --num 1000

# Run for specific time
mol $ bench greeter.hello --time 10

actions [options]

List available actions.

mol $ actions                    # List all actions
mol $ actions -f greeter.*       # Filter by pattern
mol $ actions -l                 # Only local actions
mol $ actions -i                 # Skip internal ($node) actions
mol $ actions -d                 # Show detailed info

services [options]

List available services.

mol $ services                   # List all services
mol $ services -l                # Only local services
mol $ services -i                # Skip internal services

events [options]

List available event subscriptions.

mol $ events                     # List all events
mol $ events -l                  # Only local events
mol $ events -i                  # Skip internal events

nodes [options]

List known nodes.

mol $ nodes                      # List all nodes
mol $ nodes -a                   # Show all nodes (including unavailable)
mol $ nodes -d                   # Show detailed info
mol $ nodes --raw                # Print raw registry as JSON
mol $ nodes --save registry.json # Save registry to file

info

Show broker information (version, uptime, services, transporter, serializer, etc.).

metrics [options]

Show metrics.

mol $ metrics                    # List all metrics
mol $ metrics -f process.*       # Filter by pattern

listener <eventName>

Subscribe and listen to an event in real-time.

mol $ listener user.**

load <servicePath>

Load a service from a file.

mol $ load ./my-service.js

destroy <serviceName>

Destroy a locally running service.

cache keys / cache clear [pattern]

Manage the built-in cache.

mol $ cache keys                 # List cache keys
mol $ cache clear                # Clear all cache
mol $ cache clear greeter.*      # Clear matching keys

env

List environment variables.

clear

Clear the cacher.

cls

Clear the console.

quit / exit

Stop the broker and exit.

Documentation

Please read our documentation on Moleculer site

Contribution

Please send pull requests improving the usage and fixing bugs, improving documentation and providing better examples, or providing some testing, because these things are important.

License

The project is available under the MIT license.

Contact

Copyright (c) 2026 MoleculerJS

@moleculerjs @MoleculerJS