transpiler
A tool that translates source code into another language at a similar level, such as TypeScript into plain JavaScript.
In more detail
Unlike a compiler that produces machine code, a transpiler's output is still readable source. Tools such as tsc, esbuild, SWC and Babel transpile TypeScript. Fast ones such as esbuild and SWC only remove types file by file and do no type checking.
Related terms
- TypeScript — JavaScript with added type annotations, checked by a compiler before the code runs.
- compiler — A program that translates source code a person wrote into a form a machine or runtime can execute, checking it for errors on the way.
- module customization hooks — Functions you register with module.register() or module.registerHooks() to change how Node.js finds and loads modules.
- esbuild — A very fast JavaScript and TypeScript bundler and transpiler written in Go.
- SWC — A fast TypeScript and JavaScript compiler written in Rust, used by tools such as Next.js to transpile code.
- type stripping — Running TypeScript by deleting the type annotations and executing what is left, without checking the types.
Taught in
- Native Module Systems: ESM Loader Hooks vs CommonJS — Node.js Internals & Backend Services
- ECMAScript Modules, CJS Interop And verbatimModuleSyntax — Production TypeScript