`scriptc build|run|coverage --sources[=<manifest>]` reads a scriptc-pm schema-1 manifest (default: the nearest .scriptc-pm/manifest.json above the entry) and compiles each augmented package instance from its TypeScript overlay instead of its published JS. - Instances are keyed by realpath(installedDir). The resolver redirects an import that lands in an instance's installed directory to the instance's exports inside its overlay (resolveSourceOverlayModule); overlay files compile as program modules. - tsgo gets the pilot's "paths" injection, but only for names with a single augmented instance; other instances start dropped, and a second installed copy of a redirected name drops it too. - Fallback per instance through the drop-and-reload loop: a preflight diagnostic in an overlay, a program type error naming it, a top-level require() edge to it, a lowering refusal inside it, or a program that only fails against the source surface (probe) drops the overlay and the package compiles from published JS. Reasons are reported on stderr and as "source"/"source-fallback" rows in coverage. - Build caches key by the manifest's lockDigest and bytes instead of being bypassed; the network-fetching --provenance-sources pilot stays uncacheable and becomes one more producer of the same overlay set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scriptc
Compile TypeScript and JavaScript to native executables or WASI WebAssembly modules that run without Node.js installed.
$ cat fib.ts
function fib(n: number): number {
return n < 2 ? n : fib(n - 1) + fib(n - 2);
}
console.log(fib(30));
$ scriptc run fib.ts
832040
$ scriptc build fib.ts -o fib >/dev/null && ./fib
832040
scriptc compiles the same TypeScript you run on Node.js, type-checked by the TypeScript compiler. npm packages your program imports compile along with it. Code scriptc can't compile fails the build with an error code and, where available, a rewrite hint.
scriptc is experimental. See the limitations and the Node.js compatibility reference.
Install
$ npm install -g scriptc
npm installs the native compiler for your platform (macOS, Linux, or Windows). Node.js 24 or later is needed to install it and to run WASI modules with scriptc run; compiling and running executables doesn't need Node.js.
Building executables needs a linker and the platform SDK or sysroot, such as the Xcode Command Line Tools on macOS. Set SCRIPTC_LINKER to choose the linker driver. --emit=ir|llvm|asm|obj needs no external tools. See the quickstart for details.
Commands
scriptc build <file.ts>: compile to a native executable or another artifact selected with--emit.scriptc run <file.ts>: compile and run.scriptc coverage <file.ts>: report what compiles, and explain what doesn't.scriptc build --lib --profile <profile.json>: compile a static library, or a Wasm reactor onwasm32-wasi.
See the CLI reference for every option.
Cross-compilation and WebAssembly
Set SCRIPTC_TARGET to build for another platform, for example SCRIPTC_TARGET=aarch64-linux-gnu.2.36 or SCRIPTC_TARGET=wasm32-wasi. Install the matching @scriptc/runtime-<target> package in your project, at the same version as scriptc --version, or set SCRIPTC_RUNTIME_PACK to a runtime pack directory. See platform support and WebAssembly modules.
Native code
Call C functions by declaring their signatures in TypeScript and binding them to C symbols in a manifest passed with --ffi <manifest.json>. See the Native FFI guide.
Build cache
Builds reuse a bounded persistent cache. Set SCRIPTC_NO_CACHE=1 to bypass it or SCRIPTC_CACHE_DIR to choose its location.
Docs: scriptc.dev