tsx
A command-line tool that runs TypeScript files directly in Node.js by compiling them on the fly with esbuild.
In more detail
Like Bun, tsx skips type checking for speed, so it is a development convenience rather than a replacement for tsc. Not to be confused with the .tsx file extension used for TypeScript files that contain JSX markup.
Example
npx tsx src/index.tsRelated terms
- Bun — A fast all-in-one JavaScript toolkit: a runtime that runs JavaScript and TypeScript directly, plus a package manager and test runner.
- esbuild — A very fast JavaScript and TypeScript bundler and transpiler written in Go.
- type stripping — Running TypeScript by deleting the type annotations and executing what is left, without checking the types.
- Node.js — A program that runs JavaScript outside the web browser, used mainly to build servers, command-line tools and back-end services.
Taught in
- Verify Your Environment: Running tsc And Bun TypeScript — Production TypeScript