tsx: TypeScript Execute

4.21.0 · active · verified Sat Apr 18

tsx (TypeScript Execute) is a command-line interface (CLI) tool that enhances Node.js by providing a seamless way to run TypeScript and ESM files directly, leveraging esbuild for fast transpilation. It allows developers to execute TypeScript without a separate compilation step. The current stable version is 4.21.0. The project is actively maintained with frequent minor releases and bug fixes, often occurring every few weeks.

Common errors

Warnings

Install

Quickstart

Demonstrates how to run a TypeScript file directly using the `tsx` CLI without prior compilation.

/* my-script.ts */
function greet(name: string) {
  console.log(`Hello, ${name}!`);
}

greet('TypeScript');

// To run this:
// npx tsx my-script.ts

view raw JSON →