Difference between node.js promt and .exe team

I apologize if this is really a general question, but I looked around and can not find the answer.

I am running node.js on Windows and it has 2 things, Nodejs.exe and node.js. I got a script with the propt command, but I can't figure out what the exe version does. The --debug flag that I want to use only works on exe. It looks like it works similar to pyton idle, where you can enter d = 6, then d and return the number 6, however I cannot find anything else that it does.

Can someone help explain what it is for? Thanks a ton!

+6
source share
2 answers

When installing NodeJS on Windows, there are two shortcuts:

Node applications installed on Windows

  • Node.js = This is a hidden shell for testing and executing JavaScript code. This is the same as if you typed node from the command line (assuming node.exe is on the way). This is great for simple tests (and I often use it as a calculator).
  • Node.js = this is the standard command line in which the path was configured to include node.exe (the NodeJS executable) along with npm , Node Package Manager. However, during the default installation, NodeJS directories are added to the system path, so node must be accessible from any command line.

So, using the command line (# 2), you can use it to run scripts, for example:

 node app.js 

Where app.js is the NodeJS code you wrote.

As I mentioned, node and npm are usually in the system path, so I do not use two shortcuts. Instead, I just run a new command line:

  • Win + r
  • cmd Enter
  • node enter
+10
source

When you invoke the Node executable without any arguments, you open a REPL session.

A REPL - short for Reading, Evaluation, Printing, Cycle "- is used in different ways, depending on the language / system it supports. Often, however, you will find it most useful when you:

  • Studying the system and the desire to test how fundamental concepts are implemented in the system. (Example: performing simple file system actions)
  • Testing an idea or researching a problem with code using an interactive environment, so the results can be viewed very quickly. (for example: download a small bit of code that you wrote, and call it to interactively view the output during setup)

While REPL can be useful in testing specific (and usually simple) questions, REPL fights when things get more complicated. Therefore, REPL should be understood in the broader context of the Node ecosystem, which includes tools such as Forever and node-supervisor and a healthy set of TDD parameters that can be successfully used to study and test more complex projects / problems.

0
source

Source: https://habr.com/ru/post/958258/


All Articles