ts-node: TypeScript execution for Node.js
Execute TypeScript directly without precompilation step.
Learn more about ts-node
ts-node is a TypeScript execution engine and REPL for Node.js that enables direct execution of TypeScript files without an explicit compilation step. It works by registering itself as a module loader that intercepts TypeScript file imports, transpiles them to JavaScript in memory using the TypeScript compiler API, and then executes the resulting code through the Node.js runtime. The tool supports full TypeScript language features including type checking, interfaces, generics, and modern ECMAScript syntax while respecting tsconfig.json configuration options. It integrates seamlessly with Node.js environment variables, module resolution, and the standard library, making it suitable for development workflows, scripting, and testing scenarios. The just-in-time compilation approach trades some startup performance overhead for the convenience of eliminating build tooling from the development loop.

Direct TypeScript execution
Runs TypeScript files directly without a build step by intercepting Node.js module loading and transpiling on demand. Supports both CommonJS and native ESM with configurable module resolution.
Configurable transpilation backends
Allows switching between the TypeScript compiler and SWC for transpilation, with options to skip type checking entirely for faster execution or enable full type checking as needed.
Interactive REPL with source maps
Provides a TypeScript-aware REPL for interactive development and includes source map support for debugging, allowing stack traces to reference original TypeScript source rather than transpiled output.
import { register } from 'ts-node';
// Register ts-node to handle .ts files
register({
compilerOptions: {
module: 'commonjs',
target: 'es2020'
}
});
// Now you can require TypeScript files directly
const myModule = require('./myScript.ts');
myModule.run();Fixes tsconfig.json resolution failure when using the latest TypeScript versions.
- –Upgrade to resolve tsconfig.json file-not-found errors that occur with recent TypeScript releases.
- –No breaking changes or migration steps are documented in the release notes.
Patches a Node.js 18.6.0+ bug affecting ESM loader; projects on older Node versions or without --esm are unaffected.
- –Upgrade if running Node >=18.6.0 with --esm flag to avoid loader crashes introduced by upstream Node bug.
- –No action required for projects on Node <18.6.0 or those not using ESM mode.
Fixes critical child_process.fork() bug that executed wrong script; adds .ts extension support and swc JSX/import assertion fixes.
- –Upgrade to fix child_process.fork() executing parent entrypoint instead of intended child script.
- –Set experimentalTsImportSpecifiers to use voluntary .ts extensions in import specifiers.
Top in Developer Tools
Related Repositories
Discover similar tools and frameworks used by developers
bun
Fast JavaScript runtime with built-in bundler and package manager.
ddt4all
Open-source Python application for vehicle diagnostics, ECU parameter modification, and CAN bus communication with Renault and Dacia cars.
UniTask
Zero-allocation async/await using structs and custom method builders.
json
Header-only C++ library for JSON with STL-like containers.
ohmyzsh
Community-driven zsh configuration framework with modular plugins.