Nexe: Differences from zeit/pkg?

Created on 4 Oct 2018  路  3Comments  路  Source: nexe/nexe

Differences from pkg (https://github.com/zeit/pkg)?

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):

  • 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.

All 3 comments

This isn't an issue but a request for comments contrasting two programs. Closing on that note. Anyone is free to explain the differences though.

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.

calebboyd actually provided a great comparison here https://github.com/zeit/pkg/issues/42#issuecomment-298354839

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ryancat picture ryancat  路  6Comments

Monsupito picture Monsupito  路  4Comments

transitive-bullshit picture transitive-bullshit  路  6Comments

nfrasser picture nfrasser  路  6Comments

Greg-openface picture Greg-openface  路  6Comments