explaingit

privatenumber/tsx

11,991TypeScriptAudience · developerComplexity · 1/5Setup · easy

TLDR

tsx lets you run TypeScript files directly in Node.js without a separate compile step, just install it and point it at your file and it runs.

Mindmap

mindmap
  root((tsx))
    What it does
      Run TypeScript directly
      No compile step
      Watch mode auto-rerun
    Tech Stack
      TypeScript
      Node.js
      esbuild
    Use Cases
      Quick TS scripts
      Dev tooling
      ES module support
    Audience
      JS developers
      TypeScript beginners
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run TypeScript scripts in Node.js without setting up a build pipeline or separate compilation step.

USE CASE 2

Use watch mode to automatically rerun your TypeScript code every time you save a file change.

USE CASE 3

Add TypeScript support to an existing Node.js project with a single npm install command.

Tech stack

TypeScriptNode.jsesbuildnpm

Getting it running

Difficulty · easy Time to first run · 5min

In plain English

tsx, short for TypeScript Execute, is a command-line tool that lets you run TypeScript files directly in Node.js without a separate compilation step. TypeScript is a version of JavaScript that adds type annotations, and normally you have to convert it to plain JavaScript before Node.js can run it. tsx handles that conversion automatically in the background using esbuild, a fast build tool, so you can just point tsx at a TypeScript file and it runs. The main appeal is simplicity. Rather than setting up a build pipeline with separate configuration files, you install tsx and run your files immediately. It supports ES modules, a modern JavaScript module format, and includes a watch mode that reruns your code automatically when you save changes. The project is available as an npm package, which is the standard distribution system for JavaScript and TypeScript tools. Documentation is hosted at tsx.hirok.io and includes a getting-started guide. The README in this repository is minimal and points to the documentation site for full details. The project is maintained by an independent developer and is supported by sponsors listed on the project page.

Copy-paste prompts

Prompt 1
I installed tsx. Show me how to run a TypeScript file that uses ES module imports from the command line.
Prompt 2
How do I enable tsx watch mode so my TypeScript script reruns automatically every time I save a change?
Prompt 3
I want to switch from ts-node to tsx in my Node.js project. What are the differences and how do I make the switch?
Prompt 4
Write a simple TypeScript script using ES module syntax and show me the exact tsx command to execute it.
Open on GitHub → Explain another repo

← privatenumber on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.