TypeScript runtime comparisons
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 in require()
Tested in both package types commonjs
& module
when applicable
Symbol
Description
✅
Pass (Sometimes clickable)
❌
Fail
⛔️
Error (Hover to see error message)
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.
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
✅
⛔️
⛔️
✅
⛔️
✅
✅