finds.dev← search

// the find

vercel/pkg

★ 24,324 · JavaScript · MIT · updated Jan 2024

Package your Node.js project into an executable

pkg bundles a Node.js app plus a patched Node binary into a single executable for Linux, macOS, and Windows. It was the standard way to ship Node CLIs and desktop-adjacent tools without requiring users to have Node installed, for years.

Cross-compilation works without owning the target OS for most platform/arch pairs, which is genuinely hard to replicate elsewhere. The asset/script glob config in package.json handles the common 'non-literal require' problem cleanly. Snapshot filesystem semantics (__dirname resolving to /snapshot/...) are well documented, which matters because it's the thing that silently breaks apps when people port existing code in.

It's dead: last release 5.8.1 in 2024, repo archived, and the README tells you to leave for forks or Node 21's built-in single-executable-application support. Bytecode compilation is explicitly non-deterministic, so reproducible builds require --no-bytecode, which then dumps raw source into the binary. Native addons (.node files) need manual asset wiring and version-matching against the target Node, which is a recurring source of runtime crashes. macOS arm64 support is marked experimental with mandatory code-signing gotchas that aren't optional in practice.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →