npx ts-node script.ts

Category: Node.js & npm/yarn

npx ts-node script.ts

Execute a TypeScript file directly with ts-node without compiling to JavaScript first

Runs a TypeScript file directly in Node.js without a build step. ts-node compiles TypeScript on the fly — great for quick scripts.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.