In this Nodejs tutorial, we will create a simple Application to display the output “Hello World!” in the command prompt.
NodeJs “Hello world” code to run on the command line.
var msg = 'Hello World!'; console.log(msg);
Msg is the parameter that is passed to the log method.
Now you can run the above code by running this line on the command line of a terminal or command prompt. (In case you are running on the command line).
node app.jsTHE FOLLOWING RESULT
It is not necessary to specify the file extension because it’s not mandatory.
AFTER THAT YOU WILL GET :
Hello World !”