type stripping
Running TypeScript by deleting the type annotations and executing what is left, without checking the types.
In more detail
Bun, tsx and recent Node.js versions run .ts files this way, which gives very fast feedback during development. Because nothing is type-checked, a production pipeline still runs tsc. Node.js only supports syntax that can be erased, so features that generate code, such as enums, need a flag or a full compiler.
Related terms
- type erasure — The removal of all TypeScript types when code is compiled, so none of them exist while the JavaScript runs.
- Bun — A fast all-in-one JavaScript toolkit: a runtime that runs JavaScript and TypeScript directly, plus a package manager and test runner.
- tsx — A command-line tool that runs TypeScript files directly in Node.js by compiling them on the fly with esbuild.
- Node.js — A program that runs JavaScript outside the web browser, used mainly to build servers, command-line tools and back-end services.
- verbatimModuleSyntax — The compiler option that keeps every import and export exactly as written, except those marked type, which are removed.
Taught in
- Verify Your Environment: Running tsc And Bun TypeScript — Production TypeScript