Abdel-Rahman
Abdel-Rahman

Reputation: 569

How to compile and execute typescript files using 1 command only?

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)

Upvotes: 0

Views: 4617

Answers (1)

Matthieu Riegler
Matthieu Riegler

Reputation: 54888

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

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

Upvotes: 2

Related Questions