By Alvin Alexander. Last updated: July 8, 2019
As a brief note to self, you compile a TypeScript source code file with the tsc
command:
tsc Foo.ts
Depending on what you’re doing, you can also run the resulting JavaScript file from the command line with this node
command:
tsc Foo.ts && node Foo.js
That command can be read as, “Compile the TypeScript file and then if that compiles successfully, run the resulting JavaScript file.” Note the ts and js extensions on those files.