Home > Software design >  How to compile and execute typescript files using 1 command only?
How to compile and execute typescript files using 1 command only?

Time:06-16

I know that TS is converted to JS using tsc

Then after we get .js, we execute the .js file using node.

These are 2 steps in order to execute a .ts file

My question is, how to do it in 1 step? (like one command instead of 2(tsc and node)

CodePudding user response:

You can use ts-node which will run ts files.

https://www.npmjs.com/package/ts-node

  • Related