Thinpack v0.3.1: Pack tsc into 6.5–9.0 MiB with Rust + QuickJS (vs 109.6 MiB in Bun) →

Running Node.js Apps on QuickJS (With 43 Modular Built-Ins)

Stock QuickJS is tiny, but it lacks Node’s standard library, module resolution, networking stack, and async runtime. Thinpack.js bridges that gap with 43 granular Rust capability crates so real npm CLIs work on QuickJS at 4–12 MiB.

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

How Thinpack Implements Node APIs on QuickJS

Strict Fail-Loud Parity & Honest QuickJS Limits

From docs/gaps.md and docs/reference.md, Thinpack follows a strict rule: an API either behaves like Node or throws ERR_NOT_IMPLEMENTED—it never silently fabricates stub return values.

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.

Frequently Asked Questions

How many Node.js built-in modules does Thinpack support on QuickJS?

capabilities.toml defines 43 modular crates under crates/node/* (covering fs, http, https, http2, fetch, crypto, zlib, stream, buffer, worker_threads, child_process, sea, test, sqlite, ffi, and more), with Node’s JS glue brotli-compressed inside the template.

Is QuickJS in Thinpack a full drop-in replacement for Node.js?

No. Every API follows a strict fail-loud rule: it behaves like Node or throws ERR_NOT_IMPLEMENTED rather than returning fabricated values. Native .node N-API addons are unsupported (use node:ffi), and full ICU Intl data, Temporal, and inspector are omitted.

Why do huge generated schemas like AJV standalone validators hit a QuickJS limit?

QuickJS stores lexical scope IDs in 16 bits, so a single generated function creating more than 65,535 lexical scopes fails on QuickJS. Switch that workload to --backend v8.

How much RAM and binary overhead does QuickJS add compared to V8?

A stripped Linux x86_64 QuickJS template with zero built-ins is 5.20 MiB (2.22 MiB gzip) vs 45.82 MiB for V8 Core, and WebAssembly support via WAMR adds about 217 KB. On 2,377-module pi-coding-agent, QuickJS peak RSS is 104 MB.

Related Guides & Benchmarks

4-Stage Rust Packager Architecture →

See how Oxc analysis feeds Cargo feature selection and /app VFS.

QuickJS vs Bun & Node SEA Benchmarks →

Inspect cold/warm startup times and binary sizes across 6 real CLIs.

Thinpack vs Node.js SEA →

Why /app file boundaries let real ESM & TypeScript CLIs run.

Ship 4–12 MB 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.