h2non / nar

node.js application archive - create self-contained binary like executable applications that are ready to ship and run
MIT License
428 stars 23 forks source link

Can I use nar with Electron? #122

Open abacaj opened 8 years ago

abacaj commented 8 years ago

Curious to see if nar can serve as the run-time for an electron application. (https://github.com/atom/electron)

I don't see why not, and has anyone done this - it seems like a match made in heaven.

h2non commented 8 years ago

Never tried, to be honest, but it should work. electron is a native node.js package, so it's platform specific. I think that's the unique constrain.

For instance, if you create the nararchive in OSX, and then you want to run it in Linux, you won't be able to do it. As solution, you can re-build electron on the flight from npm scripts -> preinstall command hook. Other users did this without troubles when working with native packages.

You should be able embed electron as tree or global dependency in nar. Give it a try and let me know. It would be great to create a mini tutorial about the process, other users would be interested in solutions like this.