tsgo-vs-tsc
v0.1.1
Published
Benchmark TypeScript-Go against TypeScript (tsgo vs tsc).
Readme
tsgo-vs-tsc ⚡
Benchmark the performance of TypeScript (tsc) vs TypeScript-Go (tsgo) compilers. Quickly see which compiler is faster on your project.
📦 Installation
Global install (recommended)
Using yarn:
yarn global add tsgo-vs-tscOr with npm:
npm install -g tsgo-vs-tscNow you can run the CLI from anywhere:
tsgo-vs-tscLocal install (alternative)
If you prefer project-local usage:
yarn add -D tsgo-vs-tsc
# or
npm install --save-dev tsgo-vs-tscThen run via npx:
npx tsgo-vs-tsc🚀 Usage
Basic
Benchmark compilers on your default tsconfig.json:
tsgo-vs-tscCustom config
Benchmark against a specific config file:
tsgo-vs-tsc ./path/to/tsconfig.build.jsonLocal binaries
By default, the script uses the compilers bundled with this package.
To force it to run using your locally installed versions via npx, add the --local (or -l) flag:
tsgo-vs-tsc -l📊 Example Output
🔬 Benchmarking TypeScript compilers on: ./tsconfig.json
📊 Results:
┌─────────┬──────────┬───────────┬───────────────┐
│ (index) │ Compiler │ Time (ms) │ Error │
├─────────┼──────────┼───────────┼───────────────┤
│ 0 │ tsc │ 520.31 │ None! │
│ 1 │ tsgo │ 133.84 │ None! │
└─────────┴──────────┴───────────┴───────────────┘
🏆 Fastest: tsgo (133.84 ms)⚙️ Options
| Flag | Description |
| --------------- | ----------------------------------------------------------------- |
| -l, --local | Use npx tsc and npx tsgo instead of package-bundled binaries. |
| <config-path> | Path to a custom tsconfig.json. Defaults to ./tsconfig.json. |
📌 Notes
- This tool measures compile execution time only.
- It does not check correctness of output JavaScript.
- If either compiler fails, the error is captured and displayed in the results table.
🛠 Development
Clone the repo and run locally:
yarn install
yarn build
npx tsgo-vs-tsc ./tsconfig.json