Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a stand alone command line application with Node.js [duplicate]

I'm trying to find a way to use a command line nodejs application that I created on a computer without node.js installed. In other words how to package my application with node.js inside, in order to avoid the users to have node.js already installed.

The tipical use case is: I run the application and the application works using the node core that is provide with the application (or the application checks if there is node.js installed, and if not it download and install it automatically).

Do you have any idea?

like image 607
Fab Avatar asked Mar 15 '12 17:03

Fab


People also ask

Which command runs node js code from the Command Line Interface CLI?

simple-git — a tool for running Git commands in a Node. js application.


1 Answers

JXcore allows you to do that.

Once you have JXcore installed on windows (or unix systems), all you have to do is run:

jx package app.js "myAppName" -native

This will produce a .exe (or unix executable if the command was run on a unix system) file that you can distributed and can be executed without any external dependencies whatsoever (you don't even need JXcore nor Node.js on the system).

Here's the documentation on that functionality: http://jxcore.com/packaging-code-protection/#cat-74

(Duplicate of https://stackoverflow.com/a/27551233/810830)

like image 142
Nepoxx Avatar answered Oct 23 '22 07:10

Nepoxx