Using Node.js REPL Terminal

Search for a command to run...

No comments yet. Be the first to comment.
In this tutorial series, we will understand the Fundamentals of NodeJs and learn to use Javascript on the server side.
Node Package Manager (NPM) provides two main functionalities - Online repositories for node.js packages/modules which are searchable on search.nodejs.org Command line utility to install Node.js packages, do version management and dependency manageme...
You've done it. I've done it. We've all done it.

Your AI Agent Has Amnesia. ByteRover Fixes It — Without Vectors Let's see how to built a customer support agent that remembers everything — using plain markdown files, BM25 search, zero embeddings, a

My GenAI cohort kicked off today, and what a first day! Right away we were reminded that AI isn’t magic — at its core, models like Generative Pretrained Transformers (GPT) are doing one simple thing:

Hello Folks👋, I Recently got Graduated🎓 in 2020, yep in the Pandemic. We all hit very hard by this Corona Pandemic and we all got stuck at home for very long. We all realize the Importance of Socializing, Fitness (Physically as well Mentally), Diet...

So after learning the basic commands of git in our previous section, let's see Git in action. If you already have a project to track your files then you can skip this section and if not then continue. Initializing a Repository from Non-existing Dire...

The node command is the one we use to run our Node.js scripts:
node script.js
If we omit the filename, we use it in REPL (Read Evaluate Print Loop) mode:
node
Note: REPL also known as Read Evaluate Print Loop is a programming language environment(Basically a console window) that takes single expression as user input and returns the result back to the console after execution.
If you try it now in your terminal, this is what happens:
❯ node
>
the command stays in idle mode and waits for us to enter something.
Tip: if you are unsure how to open your terminal, google "How to open terminal on ".
The REPL is waiting for us to enter some JavaScript code, to be more precise.
Start simple and enter
> console.log('test')
test
undefined
>
The first value, test, is the output we told the console to print, then we get undefined which is the return value of running console.log().
We can now enter a new line of JavaScript.
So in this section, we saw the usage of Node REPL to execute Javascript code.