Comparison of Node.js TypeScript runtimes.
Disclaimer: This comparison is by the author & maintainer of tsx
-
Tested on Node.js v12.20.0 because they all support it, and the
node:prefix is not supported inrequire() -
Tested in both package types
commonjs&modulewhen applicable
| Symbol | Description |
|---|---|
| β | Pass (Sometimes clickable) |
| β | Fail |
| βοΈ | Error (Hover to see error message) |
| tsx | @swc/register | esbuild-runner | jiti | sucrase | ts-node | tsm | |
|---|---|---|---|---|---|---|---|
| npm downloads | |||||||
| Install size | |||||||
| GitHub stars | |||||||
| Issues open | |||||||
| Issues closed | |||||||
| Last commit |
Supported transformation features and code tranformation correctness.
| tsx | @swc/register | esbuild-runner | jiti | sucrase | ts-node | tsm | |
|---|---|---|---|---|---|---|---|
| TypeScript syntax | β | β | β | β | β | β | β |
| ESM β CJS: import/export syntax | β | β | β | β | β | β | β |
ESM β CJS: import.meta.url shim |
β | β | β | β | β | β | β |
CJS scope in .js file |
β | β | β | β | β | β | β |
CJS scope in .ts file |
β | β | β | β | β | β | β |
CJS scope in .cjs file |
β | β | β | β | β | β | β |
CJS scope in .cts file |
β | β | β | β | β | β | β |
No CJS scope in .mjs file |
β | β | β | β | β | β | β |
No CJS scope in .mts file |
β | β | β | β | β | β | β |
| Source maps | β | β | β | β | β | β | β |
| tsx | @swc/register | esbuild-runner | jiti | sucrase | ts-node | tsm | |
|---|---|---|---|---|---|---|---|
| TypeScript syntax | β | βοΈ | βοΈ | β | βοΈ | β | β |
CJS scope in .cjs file |
β | β | β | β | β | β | β |
CJS scope in .cts file |
β | βοΈ | βοΈ | β | βοΈ | β | β |
No CJS scope in .js file |
β | β | β | β | β | β | β |
No CJS scope in .ts file |
β | βοΈ | βοΈ | β | βοΈ | β | β |
No CJS scope in .mjs file |
β | β | β | β | β | β | β |
No CJS scope in .mts file |
β | βοΈ | βοΈ | β | βοΈ | β | β |
| Source maps | β | βοΈ | βοΈ | β | βοΈ | β | β |
* CommonJS scope (CJS scope) refers to having the following variables available in the module scope: module, exports, require, __filename, __dirname.
Whether require()/import() can resolve a given specifier.
| tsx | @swc/register | esbuild-runner | jiti | sucrase | ts-node | tsm | |
|---|---|---|---|---|---|---|---|
.ts file |
β | β | β | β | β | β | β |
.ts file via .js |
β | β | β | β | β | β | β |
.ts file without extension |
β | β | β | β | β | β | β |
index.ts file via directory |
β | β | β | β | β | β | β |
.cts file |
β | β | β | β | β | β | β |
.cts file via .cjs |
β | β | β | β | β | β | β |
.mts file |
β | β | β | β | β | β | β |
.mts file via .mjs |
β | β | β | β | β | β | β |
node: prefix |
β | β | β | β | β | β | β |
| tsconfig.json paths | β | β | β | β | β | β | β |
| tsx | @swc/register | esbuild-runner | jiti | sucrase | ts-node | tsm | |
|---|---|---|---|---|---|---|---|
.ts file |
β | β | β | β | β | β | β |
.ts file via .js |
β | β | β | β | β | β | β |
.ts file without extension |
β | β | β | β | β | β | β |
index.ts file via directory |
β | β | β | β | β | β | β |
.cts file |
β | β | β | β | β | β | β |
.cts file via .cjs |
β | β | β | β | β | β | β |
.mts file |
β | β | β | β | β | β | β |
.mts file via .mjs |
β | β | β | β | β | β | β |
| tsconfig.json paths | β | β | β | β | β | β | β |
Whether it can correctly load a file for interoperability.
| tsx | @swc/register | esbuild-runner | jiti | sucrase | ts-node | tsm | |
|---|---|---|---|---|---|---|---|
require() .js file (ESM export) |
β | βοΈ | β | β | β | β | βοΈ |
require() .ts file (ESM export) |
β | βοΈ | β | β | β | β | βοΈ |
require() .cjs file |
β | β | β | β | β | β | β |
require() .cts file |
β | β | β | β | β | β | β |
require() .mjs file |
β | βοΈ | β | β | βοΈ | βοΈ | βοΈ |
require() .mts file |
β | βοΈ | βοΈ | β | βοΈ | βοΈ | βοΈ |
import() .js file (ESM export) |
β | βοΈ | β | βοΈ | β | β | βοΈ |
import() .ts file (ESM export) |
β | βοΈ | βοΈ | βοΈ | β | β | β |
import() .cjs file |
β | β | β | β | β | β | β |
import() .cts file |
β | βοΈ | βοΈ | βοΈ | β | β | β |
import() .mjs file |
β | β | β | β | βοΈ | β | β |
import() .mts file |
β | βοΈ | βοΈ | βοΈ | βοΈ | β | β |
| tsx | @swc/register | esbuild-runner | jiti | sucrase | ts-node | tsm | |
|---|---|---|---|---|---|---|---|
require() .js file (ESM export) |
β | βοΈ | βοΈ | βοΈ | βοΈ | βοΈ | βοΈ |
require() .ts file (ESM export) |
β | βοΈ | β | βοΈ | β | βοΈ | βοΈ |
require() .cjs file |
β | β | β | β | β | β | β |
require() .cts file |
β | β | β | β | β | β | β |
require() .mjs file |
β | βοΈ | β | βοΈ | βοΈ | βοΈ | βοΈ |
require() .mts file |
β | βοΈ | βοΈ | βοΈ | βοΈ | βοΈ | βοΈ |
import() .js file (ESM export) |
β | β | β | β | β | β | β |
import() .ts file (ESM export) |
β | βοΈ | βοΈ | β | βοΈ | β | β |
import() .cjs file |
β | β | β | β | β | β | β |
import() .cts file |
β | βοΈ | βοΈ | β | βοΈ | β | β |
import() .mjs file |
β | β | β | β | β | β | β |
import() .mts file |
β | βοΈ | βοΈ | β | βοΈ | β | β |
| tsx | @swc/register | esbuild-runner | jiti | sucrase | ts-node | tsm | |
|---|---|---|---|---|---|---|---|
| Compiler | esbuild | SWC | esbuild | Babel | Sucrase (Babel fork) | TypeScript / SWC | esbuild |
| Disk cache | β ? | β | β ? | β ? | β | β ? | β |
| tsx | @swc/register | esbuild-runner | jiti | sucrase | ts-node | tsm | |
|---|---|---|---|---|---|---|---|
| TypeScript REPL | β ? | β | β | β | β | β ? | β |
| Watch mode | β ? | β | β | β | β | β | β |
| Type checking | β | β | β | β | β | β | β |
| Hides experimental feature warnings | β | - | - | - | - | β ? | β |
| Binaries | tsx | swc-node | esr | jiti | sucrase-node | ts-node, ts-node-esm, +4 | tsm |
| tsx | @swc/register | esbuild-runner | jiti | sucrase | ts-node | tsm | |
|---|---|---|---|---|---|---|---|
| Operating systems | Linux & Windows | Linux | No tests | Linux & Windows | Linux | Linux & Windows | Linux & Windows |
| Node.js versions | 12.20 ~ 18 | Latest LTS | No tests | 16 | 14 & 16 | 12 ~ 18 + Nightly | 12.22.10 ~ 16.14 |