ts-node but extremely fast
npm i -g typescript-run ts-run ./src/index.ts
npx typescript-run ./src/index.ts
ts-run is an alias to
typescript-run. You can use either of them.
typescript-run <file-path> # or `ts-run <file-path>`
-w flag to enable watch mode. This will listen to your file changes and re-run the script.
ts-run src/index.ts --watch
By default, watch flag will watch over the files that are going to part of your bundle (
.js files imported in entry file). You can also override this behavior by passing path to
--watch flag with-
ts-run src/index.ts --watch src
This will watch over all the changes in
You can also pass multiple directories with
--watch src examples. This will watch over
When to use?
tsc for builds and
typescript-run for dev-mode.
- Not ready for serious projects
- Make sure you check out ESBuild TypeScript Caveats first.
- Type-checking is not a blocker for running scripts in dev-mode. IDEs can handle it as well as you can individually run
tscin emit mode.
Thanks! Have fun