API Reference

ts-node

TypeScript execution engine and REPL for Node.js, compiling on the fly and supporting tsconfig paths.

Official Documentation ↗
CompatibilityThis documentation covers version v10. Check the official docs for the latest API surface.

Installation

npmnpm install --save-dev ts-node

Methods

ts-node hooks into Node require and module resolution to compile TypeScript as it is loaded.

Key Features

  • On-the-fly compilation via the TypeScript compiler
  • tsconfig integration including paths
  • Programmatic register API for embedding

Usage Notes

Pin a version and check the official docs for the API surface you depend on before upgrading.

Errors

The official API reference declares the following error types:

API reference evidence

Fetched from official sources on 2026-11-08T20:07:00+08:00 via WebFetch https://typestrong.org/ts-node/docs/usage/;WebFetch https://typestrong.org/ts-node/api/index.html.

FAQ

Why is ts-node slower than tsx?
ts-node runs the full TypeScript compiler by default. Set transpileOnly: true or use the swc backend to skip type checking and start faster.
How do I avoid compiling type-check output twice?
Combine ts-node with tsc --noEmit in CI: ts-node runs tests, tsc verifies types once, so the compiler cost is paid a single time.
Does it support ESM?
Yes through the ts-node/esm loader, but it requires experimental flags on some Node versions and stricter module settings.