You must have npm, nodejs install in ur os.
On cmd or other terminal run the command
npm install -g typescriptIn any code editor write a typescript code and
save it with ** .ts ** extension.
// ignore * in commands
-
Now in terminal run these two commands one after another
command1_** tsc file_name.ts **
//tsc (typescript compiler will compile it and convert it
// into js file
then run the following command
command2_
** node file_name.js **
:) you have successfully compiled and executed ur typescript file
Top comments (0)