How to run a typescript script from the command line.

Short answer:

Run ts-node, which compiles it on the fly without saving to disk.

https://github.com/TypeStrong/ts-node

https://www.digitalocean.com/community/tutorials/typescript-running-typescript-ts-node

You can also pass --transpileOnly flag if you don't care about the error checking