Create a standalone EXE to run a Node.js application

C

Download Advanced BAT to EXE converter
(http://www.battoexeconverter.com/)

Download Node.exe from Joyent
http://nodejs.org/dist/v0.8.2/node.exe

Now we’re ready to bundle the node.js executable and our js files into a single exe file.

As for our BAT command, all we need is:

BAT Command

CD %MYFILES%/
node test.js

%MYFILES% is the variable given to the location of embedded files (more on that in a sec)

Your Advanced BAT to EXE converter window should look like the image on the left.

Don’t worry about bundling the files together just yet, we’ll do that in a sec.

For the purposes of this demo, I’ve created a very simple test.js file, that looks like this:

for(i=1;i<=10000;i++) { 
 console.log(i);
}

Save that .js file locally.

Now, from the File menu, select Build Exe (CTRL+ B)

Enter a filename for the final exe file.

EXE Options

Next, the EXE options pane will be displayed.

Click the Embed Files tab, and select both your node.exe and test.js files.

Set any other options you feel you’ll need here.

Then, simply click Build EXE.

Your executable will be bundled and in the location you chose to save it.

Run it, and you’ll have 1-10000 outputted into the console.