macOS · Linux · Windows
TypeScript-to-Native
Compiler
Compile TypeScript and JavaScript to native executables and WebAssembly. Check compilation support with coverage reports.
Compilation modes
Programs can combine native code and an optional embedded JavaScript engine. Unsupported operations produce compilation diagnostics.
Compiled statically
Supported TypeScript and JavaScript operations compile to native code. Static executables run without Node.js or a JavaScript engine.
Runs dynamically
Enable --dynamic to run npm packages and supported any-typed code in an embedded JavaScript engine. Values converted to static types are checked at runtime.
Rejected at compile time
Unsupported operations produce a diagnostic with an error code, a source location, and a rewrite hint where available.
Check compilation support
Use scriptc coverage to analyze a program before building it. The report identifies operations that compile statically, require the embedded engine, or remain unsupported.
Reading coverage reports →TypeScript type checking
The compiler uses TypeScript's type information and narrowing rules to select native representations and identify unsupported operations.
Native executables
Build a program into an executable for a supported target. JavaScript dependencies used with --dynamic are embedded at build time.
Compilation coverage
Coverage reports show static and dynamic statement counts and list compilation blockers for the program being analyzed.
Differentially tested
The test corpus compares program output and exit codes under Node.js and compiled execution. A sanitizer lane checks for memory errors.
Compile your first binary
Install the CLI, create a TypeScript file, and build an executable. The quickstart covers platform requirements and npm dependencies.