A
A
Adik Izat2019-10-11 02:07:32
Node.js
Adik Izat, 2019-10-11 02:07:32

How to create an .exe file for a NodeJS script application?

Hello, forum users! Faced the following problem. Wrote a small script on the node. To run the script, you need to write to the command line:
node index.js arg1 arg2
So! .. I would like to make an .exe file in which you could select arg1 (something like select), write arg2 (text edit zone) and click on the button to run the command higher.
I don’t know which way to move, because I’ve only recently been familiar with the node. Can you advise, good people?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Inviz Custos, 2019-10-11
@JaxAdam

https://electronjs.org/
https://nwjs.io/

S
Shohruh Shaimardonov, 2019-10-11
@joeberetta

In addition to Inviz Custos
there are also NodeGUI . He's still raw. And as they say in the official site, use Electron if you urgently need to make your application and not fool around with optimization and other problems. Well, in defense of NodGUI, I can say that this is a wrapper over Qt (google it yourself), for NodeJs. Due to this, your nodejs application will be a bit more optimized than the solution on electron / nwjs

R
rPman, 2019-10-11
@rPman

If windows, then you can even write an application (.net) with forms and buttons using the same javascript, compile it with a standard compiler that comes with the operating system (more precisely, it’s a .net framework, but everyone 100% has it because they even carry it with them driver)
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\jsc.exe is the compiler
Read the example https://www.phpied.com/make-your-javascript-a-wind... (almost the first same link from google).
The disadvantage is that by default the paths are not registered and they depend on the version of the installed framework, information about which is not in the environment variables and you can pull them out either by searching or by analyzing the registry (Microsoft does not know how to make correct and convenient environments, no way, never)
Unfortunately, you can’t find beautiful examples specifically for javascript, but if you use visual studio and look at javascript windows form examples, you can write anything.
The final exe will turn out to be several kilobytes, and at the same time almost cross-platform (you can run it on linux using mono)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question