Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 4 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

ts-node

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

Languages, types and runtimesNPM

GitHubWebsite

1. License

License from npm.

github.com/TypeStrong/ts-node

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What ts-node does

ts-node hooks Node's module loading so <code>.ts</code> files run on Node.js with no build step, and most of its options can live in a <code>"ts-node"</code> block in <code>tsconfig.json</code>, so they apply even where you cannot pass flags.

ts-node popularity

81 / 100
Gid Score, #83 overall
62.2M
downloads a week, npm
13.1K
GitHub stars
295
agent projects use it
ts-node: downloads per weeknpm, ts-node 62,172,791
ts-node: GitHub starsTypeStrong/ts-node 13,118

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How ts-node is used

  • ts-node is a dependency in 295 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (6.1% of the 4,867 JavaScript/TypeScript ones), #3 of 70 in languages, types and runtimes.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 1,342; those are left out of every share on this page.
  • The most used alternative in our scan is tsx (953 projects).
  • Projects that use it most often also use Jest (44.4%), TypeScript (95.9%), dotenv (46.1%).
  • It is more common in projects set up for Devin Desktop (8.6%) than for Claude Code (4.2%).

By coding agent

154 projects, 6.3%
151 projects, 5.0%
139 projects, 4.2%
24 projects, 8.6%
23 projects, 4.9%
22 projects, 4.7%
15 projects, 4.4%
9 projects, 8.1%

Often used with

In 44.4% of its projects
In 95.9% of its projects
In 46.1% of its projects
In 69.2% of its projects
In 49.2% of its projects
In 26.1% of its projects
In 19.0% of its projects
In 22.4% of its projects

ts-node in practice

Strengths

Options in tsconfig.json work where flags can't

Most options go in a <code>"ts-node"</code> object in <code>tsconfig.json</code>, using their camelCase names. The maintainers recommend this because it still works under <code>node --require ts-node/register</code> and in shebang scripts.

NODE_OPTIONS carries it into child processes

Setting <code>NODE_OPTIONS</code> to <code>-r ts-node/register</code> or <code>--loader ts-node/esm</code> installs the hooks in Node processes that receive the variable. The README says this enables ts-node in other node tools, child processes and worker threads "in many cases".

A faster path that skips typechecking

<code>--transpileOnly</code> (<code>-T</code>) switches to TypeScript's faster <code>transpileModule</code>. It defaults to <code>false</code>, and it can also be set with the <code>TS_NODE_TRANSPILE_ONLY</code> environment variable.

Sensible config when there is no tsconfig.json

With no <code>tsconfig.json</code> on disk, the README says ts-node uses "the newest recommended defaults" from @tsconfig/bases that are compatible with your <code>node</code> and <code>typescript</code> versions. Older TypeScript versions get an older default configuration.

Watch out for

Flags go before the script

The README says ts-node CLI flags must come before the entrypoint script, as in <code>ts-node --project tsconfig-dev.json say-hello.ts</code>.

Node's own flags need a different route

Flags such as <code>--trace-deprecation</code> cannot be passed to the ts-node binary or set in <code>tsconfig.json</code>. The maintainers recommend <code>NODE_OPTIONS</code>. The other option is to call <code>node</code> directly with <code>-r ts-node/register</code>.

<code>-P</code> is project, <code>-p</code> is print

The short flag for the tsconfig path is uppercase <code>-P</code>. The docs point out that this differs from <code>tsc</code>. In ts-node, lowercase <code>-p</code> prints the result of <code>--eval</code>.

Starting tsconfig.json with a ts-node block

{
  // This is an alias to @tsconfig/node16: https://github.com/tsconfig/bases
  "extends": "ts-node/node16/tsconfig.json",

  // Most ts-node options can be specified here using their programmatic names.
  "ts-node": {
    // It is faster to skip typechecking.
    // Remove if you want ts-node to do typechecking.
    "transpileOnly": true,

    "files": true,

    "compilerOptions": {
      // compilerOptions specified here will override those declared below,
      // but *only* in ts-node.  Useful if you want ts-node and tsc to use
      // different options with a single tsconfig.json.
    }
  },
  "compilerOptions": {
    // typescript options here
  }
}

More about ts-node

Funding
  • GitHub Sponsors: https://github.com/blakeembrey
  • GitHub Sponsors: https://github.com/cspotcode
  • 10 GitHub sponsors

See all

Head to head
Packages around it
  • typescript: TypeScript compiler
  • dotenv: Env file loader
  • @solana/web3.js: Solana JS client
  • jest: Test runner
  • prettier: Code formatter
  • @solana/spl-token: Solana token client
More in Languages, types and runtimes

Alternatives

ts-node This page

MITGid 8162.2M/wk

tsx

Node.js enhanced with esbuild to run TypeScript and ESM files.

MITGid 84146M/wk

jiti

Runtime TypeScript and ESM support for Node.js without build steps.

MITGid 67269M/wk

Compare ts-node with another tool

Get started

Install it.

npm install ts-node

Rules for your agent

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.