Skip to content
On this page

The compile sub-command ​

Compile your Pascal program to Javascript code which can be executed in web browsers.

Arguments ​

NameTypeDefault ValueDescription
inputstring./sanpasjs.pasPascal file path needed to be compiled
outputstring./dist/index.jsJavascript file path where compiled file should be placed

Sample ​

shell
sanpasjs compile --input <PASCAL_INPUT_FILE_PATH> --output <JS_OUTPUT_FILE_PATH>

Description ​

The following code will help to transpile your Pascal program to a Javascript program. Currently, this command is configured for ease of use of sanpasjs new command. For example, if you created the project using sanpasjs new command you just need to run it (no need to specify other options).

shell
sanpasjs compile

Before running the above code you need to make sure that you are in the correct folder. File explorerFile explorer

If you are not using sanpasjs new command, you need to specify file paths to run the command as shown in the sample.

Example ​

shell
sanpasjs compile --input input_pascal_file.pas --output output_js_file.js