I don't know a whole lot about PKGs approach so take this with a grain of salt. I can comment on why you might use nexe.
Nexe is a tool for compiling node. You can apply arbitrary patches and build plugins for repeatable patterns to that end. ie. You could make a plugin and or patch for nexe that bypasses the nexe application bundler and uses the same approach as pkg.
Application Bundling (just different approaches):
- nexe uses a virtual filesystem (similar to tools like asar for electron) and module analysis to include your applications files and dependencies
- pkg uses module analysis, and whitelists to create a V8 snapshot and load ("compile") your application scripts.
Why use nexe?
- You need to have additional customizations to node (eg more builtin or native modules, C++ patches).
- You want to codesign the executable. By bypassing the built in bundler (with a patch) you can create an application executable that can be signed/verified.
- You want to add an icon (there are lots of ways to accomplish this, but code is usually the best way)
- You want to extend it (plugin or patch) to provide a repeatable system for creating a specific type of application. Eg. a windows service or linux daemon.
- Its hosted builds are created with 100% OSS.
- It allows the JS engine to recompile in the future if it made bad predictions for hot code paths. (since it uses unchanged source, vs a snapshot. (This point is less relevant with the newer interpreter features)
- It provides pre-built versions for any node version.
Most helpful comment
I don't know a whole lot about PKGs approach so take this with a grain of salt. I can comment on why you might use nexe.
Nexe is a tool for compiling node. You can apply arbitrary patches and build plugins for repeatable patterns to that end. ie. You could make a plugin and or patch for nexe that bypasses the nexe application bundler and uses the same approach as pkg.
Application Bundling (just different approaches):
Why use nexe?