ts-node
TypeScript execution environment for Node.js
TLDR
SYNOPSIS
ts-node [-P config] [--transpile-only] [--esm] [options] [file] [args]
DESCRIPTION
ts-node is a TypeScript execution engine for Node.js that compiles and runs TypeScript files on-the-fly without a separate build step. By default it performs full type checking at runtime, reporting type errors before execution begins.
The --transpile-only mode skips type checking for significantly faster startup, which is useful during development when your editor already provides type feedback. ESM mode (--esm) handles ES module imports and is needed when working with import/export syntax natively. The built-in REPL provides an interactive TypeScript environment for experimentation.
Configuration is loaded from tsconfig.json by default, and a custom config can be specified with -P. The tool integrates well with development workflows using ts-node-dev or nodemon for automatic restart on file changes.
PARAMETERS
-P FILE
Path to tsconfig.json.--transpile-only, -T
Skip type checking.--esm
Use ESM loader.-e CODE
Evaluate code.-p CODE
Evaluate and print.-r MODULE
Require module.--pretty
Pretty-print errors.--skip-project
Skip loading tsconfig.json.--compiler NAME
TypeScript compiler to use.--emit
Write compiled files.-i, --interactive
Force REPL.
CAVEATS
Slower startup than precompiled JavaScript. Type checking adds overhead. Some advanced TypeScript features need configuration. Not recommended for production.
HISTORY
ts-node was created around 2015 to enable direct TypeScript execution. It became essential for TypeScript development, enabling scripts, REPL, and development servers.

