Package a Node.js app as an osx app

I want to build an interface for a series of terminal commands that our developers use to manage their development environments. I'd like to try to build it in node.js.

Now, I'm thinking I can create it as an HTML5/CSS3/JS application using express, etc... and then would like to package it as a native osx app. Meaning, an app that I can just send them, they double click on and run but that either launches a Chrome browser and navigates to the localhost:port server that hits the script or simply starts the server and instructs the user to go to the url. Either way is fine.

I am doing this because I need access to the local system to be able to configure a number of things and interact with any number of running (headless VMs). So I can't simply serve this from a server and have them visit the site.

Any ideas?

Thank you,

Luis

Here's a screencast + writeup on the subject of an installer (.pkg):

How to create an OS X pkg for NodeJS apps

As for the .app, I'm not sure yet, but I'm hot on the trail.

Also:

Check out AppJS: http://appjs.com/ - "Build Desktop Applications for Linux, Windows and Mac using HTML, CSS and Javascript"

Sounds like a good match :)

Check out http://github.com/rogerwang/node-webkit - its a project sponsored by Intel to package up Node.js apps for the desktop

Specifically, see http://strongloop.com/strongblog/creating-desktop-applications-with-node-webkit/

If you compile node.js from source every JavaScript file from nodes lib folder will be included into the binary. That same way could pack your code into the binary.

I am not familar how Mac OSX packages are created, but at the end it does not seem to be very hard. Just pack your custom node binary into one.

My answer to a duplicate question


Option 1: NW.js formerly node-webkit

The gist is that it basically extends the JS engine for you to write a web-based app supporting node's extended object model, and modules... you then package your package.json start.html modules and js files into a zip (with the .nw extension) and run it with nw(.exe) .. there are windows, mac and linux builds available.


Option 2: atom-shell

This is the shell that github's Atom editor uses. It's very similar to node-webkit, though it will run the script first, and you have to create a view/window for the user. There are some other minor differences, but it's worth looking at.


Option 3: Thrust (Node Adapter)

This is a really lose binding around webkit/chrome with an ipc channel to a launching application. You can either use the message channel, or you can write your app as a more traditional server-side app in node, and control a window launch. Which may suite you well.

Thrust has bindings for multiple languages. I put this ahead of MacGapNode only because I'm favoring cross-platform options first.


Option 4: MacGapNode (OSX Only)

MacGap with Node integration


Option 5: XULRunner

Although not NodeJS per-se, it is another option for having an HTML (XUL/HTML) based option that is JS driven. This will not include everything that the above options include, but still may be worth looking at.

This option may actually change or go away, as there have been some experiments in getting Firefox to use an enhanced HTML instead of XUL for its' shell (nothing definitive yet).


Aside: Services...

I can't speak for OSX on this as a .App, but it could well be possible to create a background service install in NodeJS and a link to a "local" site on the desktop. Most browsers have an option to not show all the features (I know firefox in particular does).

I know your question is to OSX in particular, but in windows you can use NSSM to run anything as a service, and I have used it for NodeJS based services in windows. I think some of the other options above are better depending on your needs though.


Removed: