Skip to content
Julian Waller edited this page Oct 25, 2022 · 13 revisions

So, you want to develop a module for Companion? Welcome! This wiki describes what you need to know and do to make a beautiful module being able to control your favorite gear with Companion.

Prerequisites

As of Companion 3.0, you no longer need a full development environment to make modules. You only need a full environment if you wish to edit the code at the core of Companion. You do however still need some developer tools

Companion is written in Javascript and uses the node.js runtime. That means you should be at least a little bit familiar with Javascript. Companion, Javascript and Node.js are platform independent, so you can develop on Windows, macOS or Linux and the code you write will be able to run on Windows, macOS and Linux.

1) Install node.js

There are many ways of doing this. We recommend using a version manager, to allow for easily updating and switching between versions.

In the past, we recommended using n, but that requires a version node.js to be installed first.
Our recommendation is to use fnm It is fast and cross-platform. You are free to install any other way you wish, but you will need to figure out the correct commands or ensure you have the right version at each point.

Once you have installed fnm execute the following in a terminal, to install node.js v14 and make it be the default.

fnm install 14
fnm use 14
fnm default 14
corepack enable

2) Install Companion

It is now possible to develop modules against any standard release or beta build of Companion!

You can download and install a recent version from the website

3) Clone the module

Create a companion-module-dev folder somewhere on your computer. You can call it whatever you like.
If you are working on an existing module, clone it inside this folder using your prefered git tool.
If you are making a new module, then clone the boilerplate to an appropriately named folder inside of companion-module-dev

TODO - we should recommend a free git gui tool

4) Launch and setup Companion

Once you have the companion launcher open, click the cog in the top right. This will reveal a 'Developer modules path' field. Use this to select the companion-module-dev folder you created earlier.

Launcher window

Companion will now load in any modules it finds from that folder when starting.

5) Start working on your module

You are now ready to start developing your module.

You should notice that whenever you save a file inside your companion-module-dev folder, companion will restart itself.
If it does not, or you are having issues getting your module to load in then please reach out on slack and we will be happy to assist you in getting started.

Further Reading

Clone this wiki locally