79305098

Date: 2024-12-24 08:21:49
Score: 2
Natty:
Report link

How to run TypeScript files from command line?

I think a quick Google search will lead you to this. The TL;DR is that Node.js can understand JavaScript, but not TypeScript.

Use npx ts-node src/foo.ts to convert and run the TypeScript file in one step, or do it in two steps with tsc (the first option is simpler).

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Dmitri