# ts-node — card for AI agents

TypeScript execution environment for Node.js with source map support.

Category: Languages, types and runtimes · npm package `ts-node` · latest version 10.9.2 (checked 2026-11-01)
Install: `npm install ts-node`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## ts-node
- Install locally as dev dependencies: `npm install -D typescript` and `npm install -D ts-node`. Add `tslib` and `@types/node` if the configuration needs them.
- Put ts-node options in a `"ts-node"` object in `tsconfig.json`, using camelCase names, rather than in CLI flags or shebangs.
- When using CLI flags, place them before the entrypoint script, for example `ts-node --project tsconfig-dev.json say-hello.ts`.
- Use uppercase `-P` (or `--project`) for the tsconfig path. Lowercase `-p` means print.
- Pass Node's own flags through `NODE_OPTIONS` or directly to `node` with `-r ts-node/register`. Do not put them in `tsconfig.json`.
- For native ESM, use `--esm`, `ts-node-esm`, or `node --loader ts-node/esm`.
- When config behaves unexpectedly, run `ts-node --showConfig` and `ts-node -vv` before changing settings.

## Docs written for agents
- [llms.txt (index of the docs)](https://nodejs.org/llms.txt)

## What it is
- ts-node is a TypeScript execution engine and REPL for Node.js. The README says it "JIT transforms TypeScript into JavaScript", so you can run TypeScript on Node.js "without precompiling". It does this by hooking Node's module loading APIs. The GitHub tagline adds source map and native ESM support. The repository was created on 2015-07-15 and is MIT licensed.
- Because it works through Node's loader, you can use it without its own CLI. Register it with `node -r ts-node/register` for CommonJS or `node --loader ts-node/esm` for native ESM. You can also register it in code with `require('ts-node').register()`. ts-node finds `tsconfig.json` on its own and reads compiler settings and most of its own options from it. If no file is found, it falls back to defaults from @tsconfig/bases.
- The README lists integration with test runners, debuggers and CLI tools, and says ts-node is "Compatible with pre-compilation for production". The latest GitHub release is v10.9.2, published 2023-12-08. It fixed `tsconfig.json` not being found on the latest TypeScript version.

## Caveats
- Flags go before the script: The README says ts-node CLI flags must come before the entrypoint script, as in `ts-node --project tsconfig-dev.json say-hello.ts`.
- Node's own flags need a different route: Flags such as `--trace-deprecation` cannot be passed to the ts-node binary or set in `tsconfig.json`. The maintainers recommend `NODE_OPTIONS`. The other option is to call `node` directly with `-r ts-node/register`.
- `-P` is project, `-p` is print: The short flag for the tsconfig path is uppercase `-P`. The docs point out that this differs from `tsc`. In ts-node, lowercase `-p` prints the result of `--eval`.
- tsconfig include lists are off by default: `--files` defaults to `false`, so `files`, `include` and `exclude` from `tsconfig.json` are not loaded on startup. The docs say turning it on "may avoid certain typechecking failures".
- Extra dev dependencies may be needed: You install `typescript` alongside ts-node. The README says that, depending on configuration, you may also need `tslib` and `@types/node`.

## Numbers (AgentGid data)
- Gid Score: 80.8 (#83 of all tools, 3 of 70 in its category)
- Used in 295 public projects set up for AI coding agents (4.7%)
- Downloads last week: 62,172,791 (as of 2026-11-24), +34.1% over 4 weeks
- GitHub stars: 13,118 (as of 2026-11-24)
- Last push: 2024-07-18

## Often used with
Jest 44.4%, TypeScript 95.9%, dotenv 46.1%, ESLint 69.2%, Prettier 49.2%, Axios 26.1%

## Checked alternatives (same job)
- tsx: https://agentgid.com/tools/tsx/agent.md
- jiti: https://agentgid.com/tools/jiti/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/ts-node/
- Homepage: https://typestrong.org/ts-node
- Repository: https://github.com/TypeStrong/ts-node
- Source: https://github.com/TypeStrong/ts-node#readme
- Source: https://github.com/TypeStrong/ts-node
- Source: https://github.com/TypeStrong/ts-node/releases

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
