Skip to content

Repository files navigation

NPM to EXE

Pack a JavaScript local project to a portable executable.

NPM Dependency CI & CD

NPM

Usage

# build your project first
npm run build
# pack current project
npm2exe .
# pack other project
npm2exe path/to/project

Options:

  • --arch <x86|ia32|x64|arm|arm64> target runtime architecture (ia32 maps to x86, arm maps to armv7l)
  • --platform <linux|darwin|win|win32> target platform (default current platform)
  • --node-version <version> specific runtime version (for example v22.18.0)
  • --output <name> output bundle file name (default package name; Windows appends .exe)
  • --compression-level <0-9> compression level (default 0, no compression; higher levels trade speed for a smaller archive)
  • --verbose or -V enable Verbose output

npm2exe reads your package.json#bin, installs only production dependencies into a temporary app directory, downloads a matching stock Node.js runtime, then wraps both into a self-extracting package.

Compared with Node SEA / pkg / nexe / caxa

Feature npm2exe Node SEA pkg nexe caxa
OS / CPU ✅ linux / darwin / win; x64 / arm64 / armv7l; Windows x86 ✅ stock Node target ✅ Linux / macOS / Windows / Alpine / static Linux ✅ target triple ✅ Windows / macOS / Linux
Node version ✅ build >=22; runtime auto-resolved or overridden ✅ Node SEA in official Node ✅ build >=22; node22 / node24 / latest ✅ runtime version in target string ✅ build >=22.15.0
Entry model ✅ package.json#bin, one or many launchers ⚠️ one main only ⚠️ one package entry ⚠️ one input or stdin bundle ✅ command array; multi-target output
Monorepo ✅ workspace: staging ❓ no dedicated flow documented ❓ no dedicated flow documented ❓ no dedicated flow documented ❓ no dedicated flow documented
Installed layout ✅ real app tree in home/profile ⚠️ in-binary VFS ⚠️ snapshot FS + cache extraction ⚠️ single executable VFS ✅ extracted app tree in temp/cache
Native addons ✅ normal on-disk loading ⚠️ must extract first ⚠️ supported, but extracted to cache ❌ ship beside binary ✅ extracted before run
Config ✅ low (npm2exe configuration) ⚠️ medium ⚠️ medium / high ⚠️ medium / high ⚠️ low / medium
Wrapper form ✅ 7z SFX / makeself ⚠️ injected stock Node binary ⚠️ patched runtime or SEA ⚠️ compiled single executable ⚠️ Rust self-extractor

In short: SEA, pkg, and nexe lean toward a tighter single-binary image, while caxa and npm2exe lean toward extracting and running a real app tree. That makes npm2exe especially friendly to regular Node.js install behavior and workspace: monorepos.

GitHub Actions release workflow

cd path/to/your/project

npx git-utility download https://github.com/idea2app/npm2exe main .github/workflows/ .github/workflows/

Notes:

About

Pack a JavaScript local project to a portable executable.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages