Skip to content

About

Node.js apps as one executable. Hello World on Linux x64: 4.1 MiB (Thinpack/QuickJS), 104.1 MiB (Bun), 143.7 MiB (Node SEA). Also supports V8.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

7 stars

Watchers

1 watching

Forks

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Thinpack.js logo

thinpack.js

Pack a Node.js program into a single executable. No separate Node.js, Bun, or npm install is needed to run it.

English | 简体中文

CI

Quick start

On macOS or Linux, run this in a new directory:

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

On Windows x64, extract the matching release archive, then run this in the extracted directory:

'console.log("Hello from Thinpack!")' | Set-Content -Encoding Ascii hello.js
.\thinpack.exe pack hello.js -o hello.exe
.\hello.exe

Both print Hello from Thinpack!. Replace hello.js with your app's entry point. Pack for the target OS and architecture. Keep thinpack and its runtime template together on the build machine; ship just the output executable.

Size and compatibility

A single-line console.log("hello") packs to 4.03 MiB (4,230,361 bytes) on Linux x64 CI with QuickJS and --rebuild. This is the standalone executable, including the runtime.

In a Linux x64 benchmark, tsc packed to 9.0 MiB with Thinpack and 109.6 MiB with Bun --compile. Thinpack used QuickJS with --rebuild to link only the needed built-ins. The prebuilt template is larger, and QuickJS can trade startup speed for size.

Thinpack supports many Node.js APIs, but it is not a drop-in replacement for Node.js. It does not load native Node addons. Use --include <path> to package extra files or computed local imports; paths are relative to the project root. A config file that selects a package, such as Babel's .babelrc, must be included too; the packed copy lives under /app, not in the working directory. See the Babel example. Verify important commands on every platform you ship.

About

Node.js apps as one executable. Hello World on Linux x64: 4.1 MiB (Thinpack/QuickJS), 104.1 MiB (Bun), 143.7 MiB (Node SEA). Also supports V8.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages