vercel-labs/scriptc

Developer Tools

Compiles a subset of TypeScript and JavaScript into standalone native executables or WebAssembly, without requiring Node.js at runtime.

6,474
206
TypeScript
Apache-2.0
3 months old

What it does

scriptc takes a TypeScript or JavaScript program and turns it into a native executable or a WebAssembly module. It uses the types already checked by the TypeScript compiler to guide code generation, so the resulting binary runs without Node.js. Imported npm packages are compiled into the output as well, and code the compiler cannot handle is reported at build time with a diagnostic and, where available, a suggested rewrite. It is aimed at people who want to distribute a Node-style program as a single self-contained binary.

scriptc is marked as an experimental Vercel Labs project. It supports only a subset of JavaScript, TypeScript, and Node.js APIs, so existing programs should be checked with scriptc coverage before committing to a build. The limitations page and the Node.js compatibility reference describe what is currently missing limitations, compatibility.

Install

You need Node.js 24 or later and npm to install the compiler:

$ npm install -g scriptc

The compiler itself runs natively on macOS, Linux, and Windows. Node.js is only required for installation and for running WASI modules through scriptc run. Standalone compiler archives are available from GitHub Releases if you prefer not to use npm releases.

Building executables requires a linker plus the platform SDK or sysroot. The quickstart covers these prerequisites, and the platform support page covers host requirements, cross-compilation, and WebAssembly quickstart, platform support.

Quick start

Create a hello.ts file:

const who = process.argv.length > 2 ? process.argv[2] : "world";
console.log(`hello, ${who}`);

Run it directly, which compiles and executes the result:

$ scriptc run hello.ts
hello, world

Or produce a standalone executable and run that binary:

$ scriptc build hello.ts -o hello >/dev/null
$ ./hello scriptc
hello, scriptc

On Windows, build hello.exe and run it with .\hello.exe. To gauge whether an existing program is supported before building it, run scriptc coverage hello.ts and read the report coverage reports.

Node APIs and npm packages

Supported Node APIs are compiled into the native runtime. For example, an HTTP server can be built and started without Node installed:

import { createServer } from "node:http";

const server = createServer((req, res) => {
  res.setHeader("content-type", "application/json");
  res.end(JSON.stringify({ path: req.url }));
});

server.listen(8080, () => {
  console.log("listening on http://localhost:8080");
});
$ scriptc build server.ts -o server >/dev/null
$ ./server
listening on http://localhost:8080

Imported npm packages are compiled into the executable, so the binary does not read node_modules at runtime:

$ npm install picocolors
$ scriptc build cli.ts -o cli >/dev/null
$ ./cli
hello from scriptc

Package support is partial. The npm dependencies documentation explains which packages compile and how to check them npm dependencies.

Constraints

  • Only a subset of JavaScript, TypeScript, and Node.js APIs is supported; use scriptc coverage and the compatibility reference to find out whether a given program or package works.
  • A linker and platform SDK/sysroot are needed to build executables, so a bare compiler install is not sufficient on its own.
  • Cross-platform builds and WebAssembly support have their own host requirements and are documented separately.
  • More advanced integrations, such as native program objects, C ABI functions via FFI, and embedding WASI modules, are covered in the documentation native objects, FFI, WASM.
  • The project is labeled experimental, so behavior and coverage may change.

HotRepo's take

scriptc appeared in HotRepo's all-language daily snapshots in late September 2026, gaining 76 stars on September 27 and 102 on September 28, and was still recorded on the TypeScript daily list on November 2 with 20 stars added that day, where it reached position 11. No best all-language daily rank is recorded, so the ranking story is limited to those snapshots. On Hacker News the launch thread drew 287 points and 156 comments in July 2026, and the discussion centered less on the compiler output than on process: one commenter questioned whether a serious project would adopt it comment, while another pointed to a single very large commit reply. Others compared it with Porffor's long effort toward a similar goal and were skeptical of the pace of progress comment; simonw attributed that pace to coding agents and cited contributor graphs showing 918,000 lines landed in one week reply. A separate thread of criticism argued that most npm packages ship untyped JavaScript, so a JavaScript engine would still be needed, with one reply noting that scriptc can optionally bundle a 620KB quickjs-ng engine for such dependencies comment, reply. The practical read: the compiler's value depends on how much of a given program and its dependencies fall inside the supported subset, which is exactly what scriptc coverage checks.

Written by AI from the project's README, updated . The project's own docs are the source of truth.

Hacker News

Scriptc by Vercel: TypeScript-to-Native compiler, no JavaScript engine in binary
▲ 287 · 156 comments · July 26, 2026