★ Open-source MIT · Thinpack v0.3.1 packs tsc into 6.53 MiB (vs 109.6 MiB Bun) — Star on GitHub →
Thinpack.js v0.3.1 · MIT · Rust + QuickJS / V8 / JSC

Ship Node.js apps in a 4 MiB executable.

Instead of embedding a 104–158 MiB full runtime, Thinpack traces your imports with Oxc and compiles only the Node.js built-ins your code touches.

$curl -fsSL https://raw.githubusercontent.com/thinpack-js/thinpack.js/main/scripts/install.sh | sh

100% MIT open source · Prebuilt archives bundle all 43 modules (~7.5–11.6 MiB); source --rebuild trims Hello World to 4.03 MiB and tsc to 6.53 MiB.

Packaging hello.js

Standalone executable size · MiB (smaller is better)

thinpackQuickJS
25.8× smaller
4.03 MiB
bun--compile
104.1 MiB
node SEAv26.8.1
143.7 MiB
050100150 MiB

hello.js (Linux x64): Thinpack 4.03 MiB · 25.8x smaller vs Bun

Single-line console.log("hello") on Linux x64 CI (QuickJS + --rebuild: 4,230,361 bytes; repo headline 4.1 MiB).

Why single-file Node binaries don’t have to be 150 MiB

Node.js SEA and bun build --compile ship an entire fixed runtime alongside your script. Thinpack builds the runtime around your app instead.

12–25× smaller binaries

Capability-trimmed runtime

Oxc static analysis maps your imports and globals to 43 granular crates/node/* features. Unused stdlib code is never linked with --rebuild.

6 / 6 real CLIs run

Preserves file & ESM boundaries

Runs unmodified tsc, eslint, prettier, terser, js-yaml, and pi-coding-agent (2,377 modules) where Node SEA failed on 4 of 6.

QuickJS · V8 · JSC

Pick size or V8 throughput

QuickJS is default for 4–12 MiB binaries. Need raw V8 speed for heavy compute or sub-50 ms cold starts? Pass --backend v8 anytime.

Why 150 MiB shrinks to 4–12 MiB: 43 built-ins trimmed on demand

Switch apps in the benchmark card above to see which of the 43 capabilities.toml modules get linked while unused ones stay out.

hello.js: --rebuild links minimal console/process only (1 file)
node:assertnode:clusternode:constantsnode:consolenode:perf_hooksnode:processnode:timersnode:inspectornode:modulenode:osnode:pathnode:domainnode:eventsnode:netnode:dgramnode:diagnostics_channelnode:worker_threadsnode:child_processnode:ttynode:v8node:vmnode:zlibnode:cryptonode:dnsnode:tlsnode:httpnode:fetchnode:httpsnode:http2node:readlinenode:streamnode:string_decodernode:fsnode:querystringnode:punycodenode:async_hooksnode:buffernode:utilnode:urlnode:seanode:testnode:sqlitenode:ffi

Release Bandwidth & Download Time Calculator (Measured gzip -9)

4.25 TB
Monthly CDN / CI bandwidth saved vs Bun
0.95s
Thinpack single install time
8.42s
Bun --compile single install time

typescript@5.9.3 × 100,000 downloads (gzipped): Thinpack uses 0.54 TB vs Bun's 4.79 TB

Under the hood: 4-stage Rust packager pipeline

thinpack-cli · strip-only

Packs .ts, .mts, and .cts files directly using Node’s strip-only pass and erases type-only imports prior to resolution—preserving per-file boundaries and import.meta.url.

Choose the right backend & get started

Backend Core (no built-ins) All modules Notes
QuickJS (default) 5.20 MiB (2.22 gz) 11.61 MiB (5.51 gz) Smallest footprint; static musl build available via THINPACK_STATIC=1.
V8 (THINPACK_BACKEND=v8) 45.82 MiB (16.84 gz) 52.25 MiB (20.15 gz) Full V8 JIT speed when compute/startup latency matters more than binary size (glibc Linux / macOS / Windows).
JavaScriptCore (macOS jsc) System framework System framework Uses macOS JavaScriptCore.framework instead of bundling an engine; see docs/gaps.md for ESM/SAB limits.
Quick Start: Pack any Node.js entry in seconds
macOS / Linux (QuickJS prebuilt release)
curl -fsSL https://raw.githubusercontent.com/thinpack-js/thinpack.js/main/scripts/install.sh | sh
printf '%s\n' 'console.log("Hello from Thinpack!")' > hello.js
"$HOME/.local/bin/thinpack" pack hello.js -o hello
./hello

Explore Guides & Comparisons

Full Linux x86_64 Benchmarks →

Complete size, gzip, RSS, and cold/warm startup numbers across 6 real CLIs and current main baseline.toml.

Vercel pkg & nexe Alternative →

Compare Thinpack against @yao-pkg/pkg, Node SEA, Bun --compile, and Deno compile with 3-step migration.

Compile TypeScript to Executable →

Pack .ts, .mts, and .cts files directly via strip-only lowering without bundling tsc.

Compile Node.js App to .exe →

Step-by-step Windows x64 PowerShell packaging, SHA256SUMS checks, and --include assets.

QuickJS with 43 Node.js APIs →

Deep dive into crates/node/* capabilities, vendored undici fetch, WAMR Wasm, and V8 fallback.

GitHub Actions Release Matrix →

Publish signed Linux, macOS, and Windows binaries automatically on v* tags.

Honest Engineering Trade-Offs & Compatibility Limits

No silver bullets: Thinpack is built for shipping small, portable Node.js CLIs and developer tools—not for replacing a full V8 production server. Before adopting it, check these verified limits from docs/reference.md and docs/gaps.md:
  • Cold startup latency on QuickJS: QuickJS parses JS slower than V8 or JavaScriptCore. On tsc --version, Thinpack takes 578 ms cold / 347 ms warm versus 77 ms for Node SEA; on pi --help, Thinpack takes 777 ms versus 192 ms for Bun. Switch to --backend v8 whenever latency beats download size.
  • No native N-API addons: .node native C++ addons are not loaded. Code requiring native libraries must use node:ffi instead.
  • QuickJS 16-bit lexical scope IDs: QuickJS encodes lexical scope IDs in 16 bits, so generated single-function validators exceeding 65,535 scopes (such as huge AJV standalone schemas) fail unless run on the V8 backend.
  • Fail-loud Node parity: Unsupported Node built-in behaviors throw ERR_NOT_IMPLEMENTED rather than returning fake stub values. No full ICU Intl data, Temporal, or inspector protocol is bundled.
  • Linux glibc floor: Prebuilt Linux glibc binaries from v0.3.1 require glibc 2.39+ (Ubuntu 24.04). For older Linux distros, install with THINPACK_STATIC=1 to pull the musl static archive.

Frequently Asked Questions

How does Thinpack.js pack Node.js apps to 4–9 MiB instead of 100–150 MiB?

Node SEA and Bun embed a full V8 or JavaScriptCore runtime plus the complete built-in library. Thinpack uses QuickJS by default, analyzes your module graph with Oxc, and links only the required Node built-in capability crates while compressing embedded JS sources with brotli.

What is the trade-off of using QuickJS instead of V8?

Startup and parser speed. On Linux x64 benchmarks, QuickJS cold start is roughly 4–8x slower than Node SEA or Bun (for example, tsc --version is 578 ms cold / 347 ms warm vs 77 ms on SEA, and pi --help is 777 ms vs Bun 192 ms). When throughput or startup speed matters more than size, pass --backend v8 or set THINPACK_BACKEND=v8.

Can Thinpack.js replace Node.js 100% or load native .node addons?

No. Thinpack implements many Node.js APIs and follows a fail-loud rule (behaving like Node or throwing ERR_NOT_IMPLEMENTED), but it does not load N-API or native C++ addons. Code needing native bindings goes through node:ffi.

Does Thinpack support TypeScript and ESM out of the box?

Yes. Thinpack runs Node’s strip-only TypeScript pass at pack time for .ts, .mts, and .cts files, erases type-only imports before analysis, and supports ESM, CommonJS, import.meta, and vendored Node undici fetch/WebSocket.

Ship 4–12 MiB Node.js binaries. Star thinpack.js on GitHub.

thinpack.js is 100% MIT-licensed and actively developed in Rust + JavaScript. Star the repository to follow releases or request compatibility fixtures for your favorite CLI.