Scroll to navigation

TS-NODE(1) User Commands TS-NODE(1)


ts-node - execute JavaScript and TypeScript code


ts-node [options] [-e script] [arguments]


Runs the given script, either in a file or inlined with the -e switch, using Node.js or TypeScript.
-e, --eval [code]
Evaluate code
-p, --print
Print result of `--eval`
-r, --require [path]
Require a node module before execution
-i, --interactive
Opens the REPL even if stdin does not appear to be a terminal
-h, --help
Print CLI usage
-v, --version
Print module version information
-s, --script-mode
Use cwd from <script.ts> instead of current directory
-T, --transpile-only
Use TypeScript's faster `transpileModule`
-H, --compiler-host
Use TypeScript's compiler host API
-I, --ignore [pattern]
Override the path patterns to skip compilation
-P, --project [path]
Path to TypeScript JSON project file
-C, --compiler [name]
Specify a custom TypeScript compiler

-D, --ignore-diagnostics [code] Ignore TypeScript warnings by diagnostic code

-O, --compiler-options [opts]
JSON object to merge with compiler options
Specify working directory for config resolution
Scope compiler to files within `cwd` only
Load `files`, `include` and `exclude` from `tsconfig.json` on startup
Use pretty diagnostic formatter (usually enabled by default)
Skip reading `tsconfig.json`
Skip `--ignore` checks
Prefer importing TypeScript files over JavaScript files
Logs TypeScript errors to stderr instead of throwing exceptions
November 2020 ts-node v9.0.0