Repolode
vercel-labs

vercel-labs/scriptc

A experimental TypeScript and JavaScript compiler that turns programs into native executables or WebAssembly, without requiring Node.js at runtime.

Stars
6,238
Forks
191
Open issues
56
Last commit
6 hours ago

What is it?

scriptc compiles TypeScript and JavaScript to native executables and WebAssembly. It uses the types checked by the TypeScript compiler to generate machine code, and the output runs without Node.js installed. npm packages a program imports are compiled into the executable along with it.

The project is experimental and supports a subset of JavaScript, TypeScript, and Node.js APIs. Code it cannot compile is reported at build time with a diagnostic and, where available, a rewrite hint. The `scriptc coverage` command reports how much of an existing program compiles before you build it.

The compiler installs via npm and runs on macOS, Linux, and Windows. Building executables requires a linker and the platform SDK or sysroot. Supported Node APIs such as `node:http` compile to the native runtime.

Key features

  • 01Compiles TypeScript and JavaScript to native executables.
  • 02Compiles to WebAssembly (WASI modules).
  • 03Uses TypeScript type information to generate machine code.
  • 04Bundles imported npm packages into the output binary.
  • 05Reports unsupported code at build time with diagnostics.
  • 06Includes a coverage command to check compatibility before building.

Use cases

  • Shipping a CLI tool as a single binary that runs without Node.js installed.
  • Checking how much of an existing TypeScript program can compile to native code.
  • Building WASI modules from TypeScript for embedding.
  • Running small Node-style HTTP servers as standalone executables.

Quick start

  1. 1

    Install the compiler globally with npm (Node.js 24+)

    npm install -g scriptc
  2. 2

    Create hello.ts with a short program (file content from the README)

  3. 3

    Compile and run the program directly

    scriptc run hello.ts
  4. 4

    Build a standalone executable

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

Things to know

  • Experimental: it supports only a subset of JavaScript, TypeScript, and Node.js APIs.
  • Building executables requires a linker and the platform SDK or sysroot.
  • npm package support is partial.

Topics

FAQ

What is scriptc?
A experimental TypeScript and JavaScript compiler that turns programs into native executables or WebAssembly, without requiring Node.js at runtime. scriptc compiles TypeScript and JavaScript to native executables and WebAssembly. It uses the types checked by the TypeScript compiler to generate machine code, and the output runs without Node.js installed. npm packages a program imports are compiled into the executable along with it.
Is scriptc free to use? What license does it have?
scriptc is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is scriptc still maintained?
Actively maintained. The last commit to scriptc was on Oct 19, 2026.
What can I use scriptc for?
Shipping a CLI tool as a single binary that runs without Node.js installed. Checking how much of an existing TypeScript program can compile to native code. Building WASI modules from TypeScript for embedding. Running small Node-style HTTP servers as standalone executables.
How do I install scriptc?
Install the compiler globally with npm (Node.js 24+): npm install -g scriptc Create hello.ts with a short program (file content from the README) Compile and run the program directly: scriptc run hello.ts Build a standalone executable: scriptc build hello.ts -o hello >/dev/null
Where can I get scriptc?
The source code and installation instructions are on GitHub: https://github.com/vercel-labs/scriptc

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects