Developer tools

scriptc: compile TypeScript to native executables

Vercel Labs’ experimental scriptc compiles TS/JS into standalone native executables and WASI modules with no Node runtime, for shipping CLIs and small services.

Project facts

GitHub Ecosystem
Repositorygithub.com/vercel-labs/scriptc
License
Apache-2.0
Language
TypeScript
Stars
5,950
Data checked
2026-10-06

Snapshot figures reflect the check date and may change over time.

Shipping a Node utility to a teammate means they install a runtime first. scriptc, an experimental compiler from Vercel Labs, removes that step: it compiles TypeScript/JavaScript into standalone native executables that need no Node and no JavaScript engine. The pipeline runs TS/JS through a typed IR into readable C, then through LLVM to machine code, with WebAssembly (WASI) as a second target. The repo was created in July and, as of October 6, 2026, sits at about 5,950 stars with commits still landing regularly. The README is explicit that it only supports a subset of JavaScript, TypeScript, and Node.js APIs, so it points readers to the official limitations page and Node.js compatibility reference before using it on an existing project.

Core features

  • Static compilation: TS/JS → typed IR → C → LLVM IR → assembly → object files → native executable; the output embeds a small native runtime but no Node or JS engine.
  • Diagnostics, not silent failures: code that cannot compile statically is reported as a diagnostic instead of producing a broken binary; for npm packages and any-typed code, --dynamic embeds quickjs-ng explicitly.
  • Node API coverage: a solid slice of Node built-ins (like node:http) works natively, so ordinary server scripts usually compile as-is.
  • WASM output: compiles to WASI Preview 1 modules — a second distribution path for cross-platform delivery.
  • Tiered toolchain needs: --emit=ir|c|llvm requires only Node; assembly and object tiers use platform helpers, and ordinary executable builds skip the full C toolchain.
  • Coverage self-check: scriptc coverage hello.ts reports which code compiles statically, which falls back to dynamic execution, and which isn’t supported at all — worth running on real code before committing to it.
  • Native FFI: compiled output can call C ABI functions directly; the docs give Native FFI its own page for anyone who needs to talk to system libraries.

Typical use cases

  • A useful CLI you want teammates to run with one command, no Node install.
  • A small HTTP service going into containers or edge devices without a 100MB-plus runtime.
  • Internal tools for non-technical colleagues — without the “first install your environment” conversation.

Quick start

Requires Node.js 24 or newer (the compiler itself runs on Node; the output does not):

npm install -g scriptc

Write a hello.ts, then compile and run in one step:

$ scriptc run hello.ts
hello, world

Or produce a standalone executable:

$ scriptc build hello.ts -o hello
$ ./hello scriptc
hello, scriptc

To use an npm package, add --dynamic to embed its JS straight into the executable — the result doesn’t read node_modules at runtime:

npm install picocolors
scriptc build cli.ts --dynamic -o cli
./cli

Summary

For developers who want their JS/TS programs to ship as a single file: CLI authors, full-stack devs writing internal tools, and anyone delivering small services to edge devices. It is not trying to replace Node — long-running apps and code leaning on dynamic features will still fail to compile or fall back to --dynamic. The project is explicitly tagged a Vercel Labs Experiment, Apache-2.0 licensed, and written in TypeScript, with about 5,950 stars as of 2026-10-06; before putting it in your build pipeline, run scriptc coverage on your real code to see what compiles and what falls back to dynamic execution. Building an executable also needs a platform linker and SDK/sysroot — check the official platform-support page for cross-compilation and WASI requirements.