Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to compile a JS app + the NodeJS interpreter into a single executable?

Is it possible to compile a JS application and the NodeJS interpreter into a single executable for distribution?

like image 523
Phillip B Oldham Avatar asked Aug 26 '10 20:08

Phillip B Oldham


People also ask

Can Nodejs app be compiled?

Two of the most commonly used packages used to compile JavaScript files into executables are: nexe: It is a simple command-line utility that compiles your Node. js application into a single executable file.

How can node js program be executed?

The usual way to run a Node. js program is to run the globally available node command (once you install Node. js) and pass the name of the file you want to execute. While running the command, make sure you are in the same directory which contains the app.


1 Answers

you need a linux box with git and python, then ugly solution:

$ git clone git://github.com/ry/node.git
$ cd node
$ vim src/node.js    # add your code to end before "process.loop();"
$ ./configure
$ make
$ sudo make install
$ node
like image 126
Lauri Avatar answered Oct 19 '22 23:10

Lauri