Answers for "how to compile a typescript file"

1

how to run typescript file

// First run the below command.
tsc hello.ts //tsc filename.ts  here in the example hello.ts is the file name for typescript.

//After running the above command a javascript file will be generated of same .ts file name.
//To run that file run the below command.
node hello.js

//And you will get your output.

//If you want to change the JS version then the command is.
tsc --target ES6 hello.ts //After this the same procedure as above.

// (For Windows Only ) If you are getting Security policy error then you may enter the command for the same or run the above command in the command prompt.
Posted by: Guest on May-20-2022
0

how to compile automatically in typescript

tsc <filename>.ts -w
Posted by: Guest on January-29-2022

Code answers related to "TypeScript"

Browse Popular Code Answers by Language