If you’re building a Node.js application with TypeScript, one of the first questions you’ll face is: How should I run my code during development?
You want quick reloads, smooth debugging, and minimal headaches. Two common solutions are:
- The classic combo: ts-node with nodemon
- The modern alternative: tsx
Both do the same thing compile and run TypeScript code while watching for file changes but they take different approaches. Let’s break them down.
The Classic Combo: Nodemon + Ts-node
For years, the go-to workflow has been nodemon + ts-node.
- Nodemon watches your files and restarts the app when changes happen.
- Ts-node runs TypeScript files directly, without you having to compile them manually first.
How it works
- Nodemon watches your *.tsx files.
- When something changes, it restarts your app.
- The restart runs a command like ts-node src/index.ts.
- Ts-node transpiles your code in memory and executes it.
Pros
- Mature & reliable – Years of battle-testing, with extensive docs and StackOverflow answers.
- Highly configurable – You can tune both nodemon and ts-node separately.
- Great debugger support – Works seamlessly with VS Code and other debuggers.
Cons
- More moving parts – Two tools to install and configure.
- Slower restarts – Each reload requires transpiling with the TypeScript compiler, which can drag on bigger projects.
The Modern Alternative: Tsx
Tsx is a newer, streamlined tool that combines everything into one. Built on top of esbuild (a lightning-fast bundler and transpiler), it offers incredible speed while simplifying setup.
How it works
- Run tsx watch src/index.ts .
- Tsx compiles your code with esbuild.
- Tsx re-runs your app when changes are detected no separate watcher needed.
Pros
- Blazing fast – Esbuild is dramatically faster than the TypeScript compiler.
- All-in-one simplicity – One tool does both the watching and running.
- Modern module support – Works smoothly with both CommonJS and ESM projects.
Cons
- Newer ecosystem – Smaller community compared to nodemon + ts-node.
- Less fine-tuned control – Fewer knobs if you like to deeply customize configs.
Side-by-Side Comparison
Feature | Nodemon + Ts-node | Tsx |
---|---|---|
Speed | Slower on reloads | Incredibly fast |
Setup | More complex (2 tools) | Simple (1 tool) |
Maturity | Very high | Medium |
Community Support | Extensive | Growing quickly |
Best for… | Large, complex, or existing projects needing stability | New or small-to-medium projects where speed & simplicity matter |
Which Should You Choose?
- If you’re starting a new project today: Go with tsx. The speed and simplicity will make your dev loop feel snappy and effortless.
- If you’re on a mature project with nodemon + ts-node: Stick with it unless you’re feeling the pain of slow reloads switching setups may not be worth the effort.
At the end of the day, the right choice is the one that keeps you most productive. If you’ve never tried tsx, spin up a fresh project and give it a shot you’ll probably be surprised at how much faster your dev workflow feels.
Pro tip: For production, neither tsx nor ts-node should be in play you’ll want to compile your TypeScript with tsc or esbuild and run the output JavaScript directly.
And if you’re looking for a fast, developer-friendly way to deploy your Node.js & TypeScript applications, check out DCDeploy. It’s built for modern workloads, offering bare-metal performance, DDoS protection, and a seamless developer experience so you can go from local development to production without the hassle.