how do i make an exe of my node cli application - node.js

I'm pretty new to coding and I've made a small project in nodejs with a few tools which is all run on the command line. I'm really struggling to find a way to make this an exe file and allow other people to download said exe file and run the app. Could anyone point me in the right direction of how to do this?
I've looked at packages such as nw.js and electron but these seem like they're for browser based applications - could just do with pointing in the right direction

Related

With IntelliJ 2020 Ultimate how can I run any Javascript file with nodejs?

Is there a way (in IntelliJ Ultimate) to run any javascript file with NodeJS?
I'm basically looking for the Run command to do
cd DIRECTORY-OF-FILE
node SELECTED-FILE
I would like Debug command to also work; And I realize that not every javascript file is formatted to run in nodejs. :-)
I'm looking for functionality that is built-in for Java (to be able to right click and select run or debug a *.java file).
I have a bunch of sample programs and it is a PITA to create a Run/Debug configuration for each simple script.
What have I done
I've searched the internet intellij run JS file in node
and come up with how to run a single file with NodeJS. https://www.jetbrains.com/help/idea/running-and-debugging-node-js.html#debugLocal. This works ok.
I've searched stack overflow https://stackoverflow.com/search?q=%5Bintellij-idea%5D+run+javascript+file+with+nodejs
And come up with
Project type for executing JavaScript in IntelliJ IDEA - This is very similar and if there were an answer, it would likely answer my question.
Use the Run context menu in the JS file (or the corresponding keyboard shortcut):

How to prevent sgmf-scripts to scratch sensitive files?

Right now I’m developing a SFCC Commerce Cloud website.
Referring to SFRA recommendations, I’m using the sgmf-scripts command to create, compile and upload custom cartridges.
The problem is, each time I create a cartridge, sgmf-scripts is scratching sensitive files such as dw.json, package.json or webpack.config.js, which is pretty annoying.
Does anyone know how to avoid this behavior?
Thank you
If you are open to using Visual Studio Code, you can use this together with the Prophet Debugger. The Prophet Debugger would enable you to upload your code with each change to the Sandbox and attach VS Code to Sandbox for debugging - this takes away the need to configure multiple dw.json as Prophet Debugger reads the main dw.json
Find out more about Prophet Debugger: https://marketplace.visualstudio.com/items?itemName=SqrTT.prophet

How to compile Node.JS desktop app?

to gain more experience coding and support good projects, I recently got into open source projects and Github. After looking for a project I would like to work on, I found Soundnode (https://github.com/Soundnode/soundnode-app). The project uses NW.js, Node.js and Angular.js.
The question is very fundamental: How do I run the NW.js desktop app from the given files?
I was able to compile the app once, using the bash command open -n -a nwjs --args "/Users/example/path/app". But how do I compile the changes? After changing the index.html file, which is the start for the application, I have to terminate the NW.js app and start it up again (otherwise nothing will happen) and then it opens again the same, unchanged, original app (I changed some html text to see if would load the changed index.html).
Could anyone give me a quick guide how to work with this? What I want to change and everything else I will try to figure out on my own. Just need somebody to give me a head start :)
Best Regards, bbrinx - eager to learn.
nwjs application works next ways:
direct load web files from FS or web
archive files to zip package.nw
Check nwjs manual and docs: http://docs.nwjs.io/en/latest/ and https://github.com/nwjs/nw.js/wiki
Easiest way to compile your app is to use Web2Exe. It can compile for Win, Mac, Linux.
You can use browser tools for developing/debugging your application. Set toolbar option in true in window section in package.json file to see browser elements in your app.

Is there a way to use Gruntjs without running into file path issues on Windows?

I started "using" Grunt.js yesterday, it seems to nest extensively deep folder structures in my projects, that look something like this:
assets\bootstrap\node_modules\grunt-contrib-jshint\node_modules\jshint\node_modules\cli\node_modules\glob\node_modules\minimatch\node_modules\brace-expansion\node_modules\balanced-match\Makefile
This still is a realtively short path, but there are loads of paths generated which my PC (running Windows 7) simply can't handle. I see this a well known issue as you can read in this Github issue of Node.js from 2014:
https://github.com/nodejs/node-v0.x-archive/issues/6960#issuecomment-46704998
However the issue still isn't fixed and a lot of people seem to be mad about it.
I wonder if I should get my head around Grunt at all because I didn't see a solid solution to get this working for me so far.
Even if I started using Mac (assumed Grunt.js works fine on mac), from my point of view Grunt seems to be a bad option if you want to be able to collaborate with people using windows.
Is there an easy way to use Gruntjs without running into file path issues on Windows?
*update: This is what GIT BASH throws at me when I am trying to track my files using git add .
warning: unable to access 'node_modules/grunt-contrib-compass/node_modules/bin-v ersion-check/node_modules/bin-version/node_modules/find-versions/node_modules/me ow/node_modules/read-pkg-up/node_modules/find-up/node_modules/pinkie-promise/nod e_modules/pinkie/.gitignore': Filename too long
Solution is to use GULP Or move your project to root directory of your drive, I am not sure if this is a grunt specific issue or rather a node specific issue

Deploy a node.js application (windows)

for a customer of mine i'm developing a node.js app.
I want to give him a simple setup program that handle the installation of node and relative modules in automatic without having to access the web.
Which is the best and efficient way to do that?
Thanks in advance
Just give him the node.js installer und zip your app (with node_modules directory). He just has to install node.js and extract the zip file. You could write a .bat file which starts the app. That should be easy enough.

Resources