macOS · Linux · Windows
TypeScript-to-Native
Compiler
Compile TypeScript and JavaScript to native executables and WebAssembly. Check compilation support with coverage reports.
From TypeScript to a native binary
Write the same TypeScript you run on Node.js. scriptc turns it into machine code in three steps.
Type-check
The TypeScript compiler checks your program against your tsconfig.json. scriptc uses the checked types to choose a native representation for every value.
Compile
LLVM generates machine code for your program and the npm packages it imports. Anything unsupported is reported with a code, a location, and a hint.
Ship
The result is one executable for macOS, Linux, or Windows, or a WebAssembly module. It runs without Node.js installed.
Check compilation support
Run scriptc coverage on an existing program to see how much of it compiles before you build. The report explains anything unsupported and suggests a fix.
Reading coverage reports →TypeScript type checking
The compiler uses TypeScript's type information and narrowing rules to select native representations and identify unsupported operations.
npm packages included
Packages your program imports compile into the executable, which doesn't read node_modules at runtime.
Cross-compilation
Build for Linux, Windows, and WebAssembly from one machine, and build static libraries for iOS and Android apps.
Tested against Node.js
The test suite runs each test program under Node.js and as a compiled executable and compares their output and exit codes. AddressSanitizer builds check 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.