gitwtfhub

wtf is scriptc?

vercel-labs/scriptc — explained in plain English

Analysis updated 2026-08-13

3,463TypeScriptAudience · developerComplexity · 3/5Setup · moderate

TL;DR

Scriptc compiles TypeScript and JavaScript into fast, standalone native programs or WebAssembly modules that do not need Node.js to run.

Mindmap

mindmap
  root((repo))
    What it does
      Compiles TS to native
      Compiles TS to WASM
      Reports unsupported code
      Embeds JS engine when needed
    Tech stack
      TypeScript
      LLVM
      Clang
      QuickJS
      Zig
    Use cases
      Build fast CLIs
      Ship without Node
      Target WebAssembly
    Audience
      Developers
      Tooling builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Turn a TypeScript command line tool into a single native executable with no runtime dependency.

REASON 2

Compile a small TypeScript program to WebAssembly for use in WASI compatible environments.

REASON 3

Check how much of an existing TypeScript program can compile statically before adopting the tool.

REASON 4

Bundle an npm package that relies on dynamic JavaScript features using the dynamic embedded engine.

What's in the stack?

TypeScriptLLVMClangQuickJSZigNode.js

How it stacks up

vercel-labs/scriptcknockoutez/wigololidge-jun/opencodex
Stars3,4633,4213,409
LanguageTypeScriptTypeScriptTypeScript
Setup difficultymoderateeasyeasy
Complexity3/52/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires Node.js 20 or newer and clang installed, plus Zig for WebAssembly targets.

Wtf does this do

Scriptc is an experimental tool that turns TypeScript and JavaScript code into a standalone program that can run directly on your computer, instead of needing Node.js installed to run it. It also compiles to WebAssembly, a format that can run in many different environments. It reads and checks your TypeScript the normal way, then translates it into a lower level language a standard compiler called clang understands, and that compiler produces the final native program. Programs built this way include a small built in runtime, but they do not carry a full JavaScript engine with them, so they start up quickly and stay small. If part of your code cannot be turned into a native program this way, scriptc tells you exactly where and why. For code that genuinely needs the flexibility of a real JavaScript engine, such as npm packages using dynamic features, you can pass a special flag that bundles in a small JavaScript engine just for that code. A command called scriptc coverage checks how much of a given program can be compiled this direct, fast way versus how much needs the fallback engine, which is useful for understanding whether your project is a good fit for this approach. Many common Node.js features are supported out of the box, including building simple web servers, promises, async and await, timers, and reading from the terminal. Building programs for WebAssembly targets requires an additional compiler toolchain called Zig, and some capabilities are unavailable when targeting WebAssembly, such as opening network connections directly or starting other processes, since the WebAssembly environment does not allow those by default. To use scriptc you need Node.js version 20 or newer and clang installed on your machine, though the programs it produces do not need Node installed to run. The project is still experimental and currently targets macOS, Linux, Windows, and WebAssembly.

Yoink these prompts

Prompt 1
Install scriptc globally with npm and compile a simple hello.ts file into a native executable.
Prompt 2
Explain the difference between scriptc's static native build and its dynamic mode that embeds quickjs.
Prompt 3
Show me how to build a scriptc program that uses Node's http module to run a small server.
Prompt 4
Walk me through compiling a TypeScript file to a WebAssembly WASI module with scriptc and Zig.

Frequently asked questions

wtf is scriptc?

Scriptc compiles TypeScript and JavaScript into fast, standalone native programs or WebAssembly modules that do not need Node.js to run.

What language is scriptc written in?

Mainly TypeScript. The stack also includes TypeScript, LLVM, Clang.

How hard is scriptc to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is scriptc for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.