Skip to main content

Running Scripts

The extension allows you to run javascript scripts from the IDE Extension against the Project in which the script resides. This allows for testing and debugging of scripts through your IDE.

While a script is running you will see an indicator in red in the bottom left hand corner of the IDE window.

Run a Script Without Input​

To run a script:

  1. Right click the script in the extension tree and select "Run Script"
  2. Select the name of the script in the scriptModule you want to run from the dropdown.

Run a Script with Input​

To run a script and pass it input:

  1. Right click the script in the extension tree and select "Run Script with Input"
  2. Select the name of the script in the scriptModule you want to run from the dropdown
  3. Paste or write the JSON input into the dialog and click Save

The JSON input will be passed to the script via its input parameter.

Debugging Scripts​

You may use console logs in your scripts to help develop and debug. However, the output of console logs in your script do not show up in vs code's Debug Console. To access the console with logs from your script, select "Open Twinit IDE Console" in the extension menu at the top of the extension tree.

You can also open the IDE's developer tools:

  1. Press CTRL-SHIFT-P
  2. Type 'Developer Tools'
  3. Select 'Developer: Toggle Developer Tools'

This will open a new window with a console log which will display the outputs from your scripts.