TypeScript Execute (tsx)
tsx stands for TypeScript Execute and it's a Node.js enhancement to run TypeScript.
For starters, think of tsx as an alias to node and use it the same way:
sh node file.js →↓ sh tsx file.ts
You can pass in Node CLI flags and JS files too:
sh tsx --env-file=.env ./file.js
Seamless TypeScript execution
Run TypeScript code without worrying about configuration!
tsx runs your TypeScript code with modern and sensible defaults, making it user-friendly and especially great for beginners.
Seamless CJS ↔ ESM imports
... continue reading