Creating your own Module
Setting up your node module
First we need to create a new directory and initialize our node package:
Workspace Directory
tsconfig.json
We need to tell the typescript command tsc
how to compile our project. Create the following file in your project root and name it tsconfig.json
:
testbot-module-test/tsconfig.json
Test Command Logic
Our TestCommand
class will consist of constructor and run methods.
It's important that our class extends the CommandBase class! Create a file called index.ts
in our modules src/
directory.
testbot-module-test/src/index.ts
If you want to have multiple commands you can separate them into separate class files and export them in the index.ts
file. The index.ts
file is a "barrel file" that is called by require()
Last updated