How to run code
-
I am but a lowly amateur, so I was wondering how to run the code I have written. Is there a built-in function, or do I need to use an online compiler?
-
Notepad++ is just an editor. It doesn’t come with any type of compilers or interpreters. So you will have to get your own for whatever language you are using.
That being said there plugins you can use to help run compilers/interpreters from Notepad++, but it tends to not be as useful as a full IDE that is made to handle a specific language. But it really depends on the language you are using.
-
I do believe I am attempting to run .js files. Is Node.js useful for this?
-
No clue personally. The little bit of JavaScript I’ve wrote personally I just load it up from an HTML page in a browser.
-
@Robbie-Koble The top tool (IMHO) for running stuff from inside Notepad++ is the NppExec plugin. You can download it with the Plugin Manager. It enables you to run compilers, interpreters, linters and pretty much everything you’ll ever need from inside Notepad++.
Also, it is vital that we understand what you are trying to achieve for us to give useful advice.
There are two (related, but still vastly different) types of files that have a .js extension: (a) MS JScript files that can be executed directly by the Windows Scripting Host (WSH), (b) JavaScript files that are usually executed client-side inside a web browser. I am not aware of any way to run JavaScript without a browser, but I might be wrong here.
If you want to learn JavaScript, there are a lot of free courses around these days, personally I recommend freeCodeCamp.
-
Go to the Rhino Web Site, download the Rhino interpreter and follow the instructions for running it within the OS window. You can run little snippets, define and run functions and see the output immediately; kind of basic and lacking special environment vars that might be available in a browser, but still a valuable tool.
The other option that I can think of is to create a template HTML doc to test Javascript in, that will take inputs and generate output (check out W3 Schools and their Javascript section for examples of how they do it).