tsx Run TypeScript directly
Light · Postcard
102 × 152 mm · PDF
Dark · Postcard
102 × 152 mm · PDF
Ink saver · Postcard
102 × 152 mm · PDF
Light · A4 landscape
297 × 210 mm · PDF
Dark · A4 landscape
297 × 210 mm · PDF
Ink saver · A4 landscape
297 × 210 mm · PDF
Light · A3 landscape
420 × 297 mm · PDF
Dark · A3 landscape
420 × 297 mm · PDF
Ink saver · A3 landscape
420 × 297 mm · PDF
Start here
npx tsx <file.ts>
tsx <file.ts> <args>
tsx watch <file.ts>
tsxnpm i -D tsxtsx --tsconfig <path> <file.ts>
node --import tsx <file.ts>
tsc --noEmitConcepts
- file.ts your source
- tsx loader on top of node
- node runs the code
- Type errors found by tsc only
Install
npx tsx <file.ts>
npm install -D tsx
npm install -g tsx
tsx --versionRun
tsx <file.ts>
tsx <file.ts> <args>
tsx -e "<code>"
tsx -p "<expr>"
tsx --import <module> <file.ts>
tsx --env-file=<file> <file.ts>
tsx --no-cache <file.ts>
tsx --enable-source-maps <file.ts>
./script.tsWatch
tsx watch <file.ts>
tsx watch --include "<glob>"
<file.ts>
tsx watch --exclude "<glob>"
<file.ts>
tsx watch --clear-screen=false <file.ts>
Enter (in watch mode)
Config
tsx --tsconfig <path> <file.ts>
TSX_TSCONFIG_PATH=<path> tsx <file.ts>
TSX_DISABLE_CACHE=1 tsx <file.ts>
Use with node
node --import tsx <file.ts>
node --import tsx --test
tsx --testnode --require tsx/cjs <file.ts>
import { tsImport } from 'tsx/esm/api'
tsx --inspect <file.ts>
tsx -iRecipes
"dev": "tsx watch src/index.ts","start": "tsx src/index.ts","typecheck": "tsc --noEmit"
tsx watch --env-file=.env --exclude "./logs/**" src/server.ts
tsc --noEmit && tsx src/job.ts <arg>
node --import tsx --test "src/**/*.test.ts"



