Skip to content

Commit 49b9870

Browse files
Arnalvsumn2u
authored andcommitted
Update nodejs.md
1 parent ba4a145 commit 49b9870

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

en/server-side/nodejs.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@ This should print the version number of Node.js like this:
2626
```bash
2727
v20.7.0
2828
```
29+
## Running the Node.js REPL
30+
31+
REPL stands for Read Evaluate Print Loop, and allows you to run code from the terminal.
32+
Type into your terminal this command:
33+
34+
```bash
35+
node
36+
```
37+
In this prompt, you can run code, like this:
38+
39+
```js
40+
> console.log("Hello World")
41+
```
42+
You can leave the REPL by typing CTRL + d
2943

3044
## Writing your first Node.js program
3145

@@ -51,7 +65,13 @@ Hello World!
5165

5266
Express is a popular web framework for Node.js. It provides a simple and elegant API for building web applications. Let's use Express to create a simple web server that will respond to HTTP requests with a "Hello World!" message.
5367

54-
First, we need to install Express. To do this, run the following command in your terminal:
68+
But before we install Express, we must first run this in order to set up npm, javascript's package manager:
69+
70+
```bash
71+
npm init
72+
```
73+
74+
Then, you install express
5575

5676
```bash
5777
npm install express

0 commit comments

Comments
 (0)