Package a Node.js application as an OS X application

前端 未结 5 1045
旧时难觅i
旧时难觅i 2021-02-01 07:06

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.

5条回答
  •  醉酒成梦
    2021-02-01 07:46

    Option 1: electron (aka 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 2: 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 3: Carlo chrom(ium) shell from Node.

    This will allow you to launch the locally installed Chrome as a shell that can connect to a locally running server application. It does require a local chrome, but is very close to what was asked for.


    Option 4: MacGapNode (OSX Only)

    MacGap with Node integration (Seems to be getting stale)


    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:

    • nexe - stale/unmaintained
    • AppJS - replaced with DeskShell
    • DeskShell - stale, website offline
    • node-webkit -renamed to NW.js
    • XULRunner project stalled, and exceedingly behind.
    • Thrust (Node Adapter) - deprecated/stale

    This answer is copied for multiple questions, these references are mostly for updating convenience.

    • Packaging a node.js webapp as a normal desktop app [closed]
    • Package a Node.js app as an osx app

提交回复
热议问题