Navigate:
All Reposts-node
~$TSNODE0.0%

ts-node: TypeScript execution for Node.js

Execute TypeScript directly without precompilation step.

LIVE RANKINGS • 06:53 AM • STEADY
OVERALL
#254
11
DEVELOPER TOOLS
#52
3
30 DAY RANKING TREND
ovr#254
·Devel#52
STARS
13.1K
FORKS
542
DOWNLOADS
28.7M
7D STARS
+2
7D FORKS
0
See Repo:
Share:

Learn more about ts-node

ts-node is a TypeScript execution engine and REPL for Node.js that enables direct execution of TypeScript files without an explicit compilation step. It works by registering itself as a module loader that intercepts TypeScript file imports, transpiles them to JavaScript in memory using the TypeScript compiler API, and then executes the resulting code through the Node.js runtime. The tool supports full TypeScript language features including type checking, interfaces, generics, and modern ECMAScript syntax while respecting tsconfig.json configuration options. It integrates seamlessly with Node.js environment variables, module resolution, and the standard library, making it suitable for development workflows, scripting, and testing scenarios. The just-in-time compilation approach trades some startup performance overhead for the convenience of eliminating build tooling from the development loop.

ts-node

1

Direct TypeScript execution

Runs TypeScript files directly without a build step by intercepting Node.js module loading and transpiling on demand. Supports both CommonJS and native ESM with configurable module resolution.

2

Configurable transpilation backends

Allows switching between the TypeScript compiler and SWC for transpilation, with options to skip type checking entirely for faster execution or enable full type checking as needed.

3

Interactive REPL with source maps

Provides a TypeScript-aware REPL for interactive development and includes source map support for debugging, allowing stack traces to reference original TypeScript source rather than transpiled output.


import { register } from 'ts-node';

// Register ts-node to handle .ts files
register({
  compilerOptions: {
    module: 'commonjs',
    target: 'es2020'
  }
});

// Now you can require TypeScript files directly
const myModule = require('./myScript.ts');
myModule.run();

vv10.9.2

Fixes tsconfig.json resolution failure when using the latest TypeScript versions.

  • Upgrade to resolve tsconfig.json file-not-found errors that occur with recent TypeScript releases.
  • No breaking changes or migration steps are documented in the release notes.
vv10.9.1

Patches a Node.js 18.6.0+ bug affecting ESM loader; projects on older Node versions or without --esm are unaffected.

  • Upgrade if running Node >=18.6.0 with --esm flag to avoid loader crashes introduced by upstream Node bug.
  • No action required for projects on Node <18.6.0 or those not using ESM mode.
vv10.9.0

Fixes critical child_process.fork() bug that executed wrong script; adds .ts extension support and swc JSX/import assertion fixes.

  • Upgrade to fix child_process.fork() executing parent entrypoint instead of intended child script.
  • Set experimentalTsImportSpecifiers to use voluntary .ts extensions in import specifiers.


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers