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

iot-simulator-cli

v1.0.4

Published

CLI-based IoT device simulator for MQTT and RabbitMQ with interactive device control, telemetry generation, and config-driven virtual device simulation.

Readme

🐇 IoT Simulator CLI

A CLI-based IoT device simulator built with Node.js and RabbitMQ (MQTT). This tool allows users to generate device configurations, simulate virtual IoT devices, and interact with them directly from the terminal.


🚀 Features

  • CLI-based IoT device simulation
  • MQTT communication using RabbitMQ
  • Interactive terminal device control
  • Dynamic telemetry payload generation
  • Config-driven simulation architecture
  • JSON-based device configurations
  • Runtime device interaction shell

⚙️ Installation

Install dependencies:

npm install

Install CLI globally from project root:

npm install -g .

🐳 RabbitMQ Setup (Docker)

This project includes a Docker Compose setup for running RabbitMQ with MQTT support enabled.

Start RabbitMQ

Build and start the RabbitMQ container:

docker-compose up -d --build

This will:

  • Build the RabbitMQ image
  • Enable MQTT support
  • Start RabbitMQ in detached mode
  • Expose MQTT and Management UI ports

Stop RabbitMQ

docker-compose down

Reset RabbitMQ Data

To remove all persisted RabbitMQ data:

docker-compose down -v

Then start again:

docker-compose up -d --build

RabbitMQ Management UI

Access the management dashboard:

http://localhost:15672

Credentials are loaded from:

rabbitmq.env

Exposed Ports

| Port | Purpose | | ----- | ---------------------- | | 5672 | AMQP | | 15672 | RabbitMQ Management UI | | 1883 | MQTT |


🛠 Available Commands

Create Device Configuration

Generate a new device configuration interactively:

iot-sim device create

This creates a device configuration JSON file with default MQTT topics, payload generators, and simulation settings.

Generated configs are stored in:

./devices/

Generate Device Template

Generate a reusable device template configuration:

iot-sim device template <deviceId>

Example:

iot-sim device template sensor01

This creates a template-based configuration file for the provided device ID.


Start Device Simulator

Start a virtual IoT device simulator:

iot-sim device start <deviceId>

Example:

iot-sim device start sensor01

The simulator loads the device configuration, connects to RabbitMQ using MQTT, and starts publishing/subscribing to device topics.


💻 Interactive Device Shell

Once a device simulator starts, an interactive terminal shell is opened for runtime control.

Example operations:

  • Publish telemetry
  • Check device status
  • Simulate reconnects
  • Trigger failures
  • Stop device simulation

🔄 How It Works

  1. Device configurations are stored as JSON files
  2. CLI commands initialize virtual devices
  3. Devices connect to RabbitMQ via MQTT
  4. Telemetry payloads are dynamically generated
  5. Interactive shell allows live device control

📁 Configuration Driven

Each simulated device is fully config-driven and contains:

  • Device identity
  • MQTT credentials
  • Topic mappings
  • Payload generators
  • Simulation intervals

This enables scalable IoT simulation without modifying source code.


🧠 Use Cases

  • MQTT testing
  • IoT backend development
  • Event-driven architecture testing
  • RabbitMQ integration testing
  • Local IoT environment simulation
  • Device telemetry emulation

📄 License

This project is licensed under the MIT License.