Install typescript (tsc) globally
You can use npm to install TypeScript globally, this means you can use the tsc command anywhere in your terminal.
To do this, run npm install -g typescript. This will install the latest version (currently 4.2).
Then verify:
1 |
tsc --version |
ts init
Do this once. Will generate a tsconfig file.
Then all you have to do is tsc to compile all typescript files into js files for the directory.
You can also add watch to it: tsc -w