A library for creating DCC++EX commands.

Usage no npm install needed!

<script type="module">
  import cloudthrottleDccExCommands from 'https://cdn.skypack.dev/@cloudthrottle/dcc-ex--commands';


DCC++ EX Command Library

A Javascript library to help create DCC++ EX Command strings.

A developer friendly approach to creating command strings that can be sent to a DCC++EX Command Station


Quick Start

<script type="module">
    import * as DCCCommands from 'https://cdn.skypack.dev/@cloudthrottle/dcc-ex--commands';

    console.log(DCCCommands.powerCommand({power: 1, track: "MAIN"}));
    // <1 MAIN>

NPM Package

Install with npm

  npm install @cloudthrottle/dcc-ex--commands
import {throttleCommand} from "@cloudthrottle/dcc-ex--commands";

const commandString = throttleCommand({
    cab: 22,
    speed: 126,
    direction: 1

// <t 1 22 126 1>


Try out some commands



Clone the project

  git clone https://github.com/cloudthrottle/dcc-ex--commands.git

Go to the project directory

  cd dcc-ex--commands

Install environment. This project requires Node v16.8 or above. If node is already installed this step can be skipped. asdf is recommended due to it's simplicity

  asdf install

Install dependencies

  npm install

Run the test suite

  npm test


Here are some related projects