npx tsx script.ts

Category: Node.js & npm/yarn

npx tsx script.ts

Run a TypeScript file directly with tsx

Executes a .ts file using tsx, the esbuild-powered runner that needs no tsconfig or compile step. Great for quick scripts and migrations without setting up a build. For type-checking only, use tsc --noEmit.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.