ternTS · Comparison
ternTS vs swc, esbuild, tsc and tsgo.
Every TypeScript project ends up choosing a transpiler. Here’s how they differ on what matters day to day: speed, decorator metadata, type checking, and whether you get the JavaScript tsc would have written.
At a glance
| ternTS | swc | esbuild | tsgo | tsc | |
|---|---|---|---|---|---|
| NestJS, 1,959 files, one thread | 32 ms | 202 ms | not measured | 624 ms | 1,440 ms |
| VS Code, 13,454 files, one thread | 1.33 s | 6.07 s | not measured | 22.2 s | 40.2 s |
| Type checking | no | no | no | yes | yes |
Decorator metadata (emitDecoratorMetadata) | yes | yes | no | yes | yes |
| Output identical to tsc’s | yes, checked on 37,319 files | no: its own helpers and output | no | close, not checked | — |
| Lowest target | ES2015 | ES5 | ES2015 (ES5 only in part) | ES2015 | ES5 |
| Bundling | no | no | yes | no | no |
| Written in | Tern | Rust | Go | Go | TypeScript |
Timings: transpiling in-process on an Apple M4 Pro with Node 24, swc 1.16.12, TypeScript 5.9.3 and tsgo 7.0.2; node bench/run.mjs in the ternTS repository reproduces them. esbuild isn’t in that benchmark. Its lack of metadata support is in esbuild’s own TypeScript caveats.
Which one to use
You need type errors: tsc or tsgo
Only tsc and tsgo (the Go port that becomes TypeScript 7) check types. Everyone else, ternTS included, assumes you run one of them as well, in CI or your editor, usually as tsc --noEmit. A common setup is a fast transpiler for builds, dev servers and tests, plus a type check that runs on its own.
You use decorators with metadata: ternTS
NestJS, TypeORM, Angular, type-graphql and InversifyJS read the types that emitDecoratorMetadata writes. esbuild doesn’t emit them, so those apps break under it. swc emits them with its own helpers, and its output isn’t tsc’s. ternTS writes what tsc writes, checked file by file against TypeScript 5.9: the whole NestJS repository, all of Nest’s 3,631 unit tests, and nine Nest apps that answer the same requests byte for byte, Swagger and GraphQL schemas included. See the NestJS guide.
You’re replacing ts-jest or @swc/jest: ternTS
On Nest’s repository the ternTS Jest transform takes 267 ms, against 392 ms for @swc/jest and 2,390 ms for ts-jest, with one line of config to switch. See the Jest guide.
You need ES5 output: swc or tsc
ternTS lowers every target from ES2015 up exactly as tsc does. If you still ship to browsers without ES2015, use swc or tsc.
You’re bundling a frontend: esbuild (or Vite)
esbuild is a bundler first. If you don’t need decorator metadata, it’s a fine way to strip types while you bundle. If you do, the ternTS Vite plugin (@ternlang/ternts/vite) compiles TypeScript the way tsc does before Vite bundles it.
Why ternTS is faster
ternTS has no syntax tree for most of a file. Its parser walks the tokens and copies your source straight through, editing only the parts TypeScript adds: types, decorators, enums, parameter properties. Most TypeScript is already JavaScript, so most bytes are copied, never rebuilt. It’s written in Tern, a compiled language, and the whole transpiler is about 10,000 lines. It runs as a native binary, or as 1 MB of WebAssembly in the playground.