Node Js hello world program


Hi friends, in this tutorial, you will learn how to run or execute your first node js hello world program. If you are wondering how to do this, then you have come to the right place. Before getting started with node js, let us discuss node js a little bit.

What is node js and why node js

Node js is open source and provides a server-side environment which means it used javascript on the server side instead of client-side and all the files are declared with .js extension. Node js can handle multiple requests at once and return the responses at the same time but other scripting languages such as PHP can not take multiple requests from the client machines simultaneously.

Also, read, the Node JS HTTP server example

Node js programs can be executed in two ways as given below.

  • By using the command line interface i.e. cmd
  • By using the vs code editor

Steps to run the node js hello world program using the command line interface

Step 1:- download node js from here and install it in your system.

Step 2:- Open the command line interface in your system.

Step 3:- Type node and press ENTER to check whether node js is properly installed in your system in CLI.

Step 4:- you will see the output as shown below

C:\Users\Lenovo>node
Welcome to Node.js v18.16.0.
Type “.help” for more information.
>

if you see the above information then you are confirmed that node js is installed and you can debug or print anything you want with the help of the console class. Note that the javascript console is different from than console provided by the node.
Now, you can run the node js hello world program as shown below

console.log(“Hello World”);
Hello World
undefined

Note that log is a function used with the console class provided by node js. As soon as you write anything inside the log() function and press ENTER, it will print the value inside the log() function. Undefined is shown just to let you know that log() does not return anything.

Also read, How to Import Custom Module in Node JS

Using the vs code editor

  • First of all, download and install the vs code editor.
  • Now, create a file inside the vs code editor with .js extension as shown below
Node Js hello world program
  • Now, open the js file you created and write “Hello World” inside console.log() and save the file using CTRL+S.
  • Now open the terminal inside the vs code editor as shown below
Node Js hello world program
  • In the terminal, type node filename and press ENTER.
  • It will display the output as Hello World as shown below.
Node Js hello world program

Conclusion:- I hope this tutorial will help you to understand the concept. If you have any doubts then please leave a comment below.


Leave a Comment

RATU311

RATU311

RATU311

RATU311

RATU311

RATU311

RATU311

RATU311

RATU311

RATU311

RATU311

KUPU178

RATU311

RATU311

RATU311

judi bola

live casino

sv388

sv388

sabung ayam online

sabung ayam online

Thor311 Terbaru

CERI188: Taruhan Bola Sbobet

THOR311 DEMO SLOT

THOR311 MAHJONG

RATU311: BONUS SABUNG AYAM

CERI188

parlay

RATU311

KUPU178

RATU311

THOR311

KUPU178

RATU311

RATU311

RATU311

RATU311

RATU311

RATU311

CERI188

CERI188: Masuk Akun Slot Super Cepat

KUPU178: Slot Online Mahjong Bet 200

THOR311 PRO

THOR311

CERI188

CERI188

CERI188

CERI188

CERI188

CERI188

CERI188

CERI188

CERI188

THOR311

HOKI311

HOKI311

RATU311

RATU311

RATU311

KUPU178

THOR311

KUPU178

THOR311

RATU311

HOKI311

KUPU178

KUPU178

RATU311

THOR311 TOTO4D

KUPU178

Live Casino Roullate

RATU311

RATU311

RATU311

RATU311

RATU311

THOR311

THOR311

THOR311

RATU311

CERI188

DAFTAR KUPU178

LINK DAFTAR CERI188

CERI188

APK KUPU178

KUPU178

CERI188

CERI188

RATU311

KUPU178

THOR311 DOMINO QQ

judi bola online

Mix Parlay

CERI188

CERI188

CERI188

RATU311

live casino online

RATU311

Mix Parlay

Sabung Ayam Online

Slot PG Soft

CERI188

RATU311

RATU311

RATU311

CERI188

THOR311

CERI188

THOR311

Game Thor311

THOR311

HOKI311

live casino

sv388

HOKI311

HOKI311

slot mahjong

Thor311 Alternatif

RATU311

HOKI311

HOKI311

HOKI311

HOKI311

CERI188

THOR311 RESMI

THOR311 AKSES

THOR311

THOR311 RTP

THOR311

parlay

HOKI311

THOR311

Thor311 Aplikasi

RATU311 NONTON BOLA

CERI188 Link RTP LIVE

THOR311

Thor311 Live Casino

CERI188

akses VIP THOR311

THOR311

link daftar THOR311

THOR311

situs thor311

RATU311

HOKI311 Link SABUNG AYAM RESMI

HOKI311 Link QRIS EWALLET

RATU311

LINK CERI188

parlay

HOKI311 Link RTP Gacor

THOR311

HOKI311 Link Apk Resmi

CERI188

KUPU178 Link Daftar

CERI188

CERI188

CERI188

CERI188

CERI188

HOKI311

RATU311

RATU311

RATU311

HOKI311 Lapak Arena Slot

RATU311 judi bola

HOKI311 Link Spaceman Online

HOKI311 Link Daftar Resmi

CERI188 Toto SGP Online

KUPU178

KUPU178

KUPU178

KUPU178

HOKI311 TEMBAK IKAN ONLINE

KUPU178

HOKI311 Link Login Alternatif

HOKI311 Live Casino Online

HOKI311 Situs Slot Gacor

THOR311

THOR311

situs judi bola

Ceri188 Game Online

CERI188

link login CERI188

link login CERI188

CERI188

THOR311

HOKI311

HOKI311

CERI188

parlay

THOR311

RATU311

HOKI311

HOKI311

parlay

HOKI311

RATU311

THOR311

KUPU178

HOKI311

KUPU178

KUPU178

HOKI311

parlay

slot gacor

kupu178 link alternatif

kupu178 slot

kupu178 daftar

kupu178 login

link daftar kupu178

judi bola

HOKI311

RATU311

link alternatif RATU311

Link daftar RATU311

link login RATU311

RATU311

RATU311

KUPU178

KUPU178

THOR311

KUPU178

KUPU178

RATU311

RATU311

RATU311

RATU311

RATU311

RATU311

RATU311

THOR311

KUPU178

KUPU178

HOKI311

THOR311

KUPU178

THOR311

THOR311

slot thailand

judi bola

THOR311

THOR311

KUPU178

THOR311

THOR311

slot gacor

slot gacor

yakuza303

unobet77

slot gacor

slot gacor

RATU311

parlay

parlay

slot gacor

parlay

THOR311