Run a TypeScript script directly from the command line without compiling it to JavaScript first.
Open an interactive TypeScript REPL to quickly test TypeScript expressions and explore types.
Connect TypeScript source files directly to Jest, Mocha, or another test runner without a build step.
Use ts-node with swc for faster startup in projects where type checking happens in the editor or CI instead.
Type checking is off by default for faster startup, enable it with a flag if you want runtime type error detection.
ts-node lets you run TypeScript files directly on Node.js without a separate compile step. Normally, TypeScript code needs to be converted to JavaScript before Node.js can run it. ts-node handles that conversion on the fly as it loads each file, so you can write a .ts file and execute it immediately the same way you would a .js file. The main use cases are running one-off scripts, working in an interactive TypeScript prompt (called a REPL), and connecting ts-node to test runners, debuggers, or build tools that expect to call TypeScript files directly. It reads your existing tsconfig.json automatically, so any compiler settings you have already configured will apply without extra setup. Installation is done through npm, either project-local or globally. Once installed, you replace node with ts-node at the command line. For example, ts-node script.ts runs a TypeScript file, and ts-node on its own opens the interactive prompt. Several shortcut commands are included for common modes, such as ts-node-esm for the native ES modules format. ts-node offers flexibility for different performance needs. Full type checking is optional and off by default, which keeps startup fast. You can turn it on if you want ts-node to catch type errors at runtime, or leave it off and rely on your editor or CI pipeline for that instead. It also supports swapping in a third-party transpiler (such as swc) for faster startup when type checking is not needed. Configuration happens through the tsconfig.json file or command-line flags. Common options include skipping node_modules, scoping transformations to a specific directory, and controlling how CommonJS and native ECMAScript modules are handled together. The full README is longer than what was shown.
← typestrong on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.