๐ Day 1: Introduction to Node.js โ Setup, Running JavaScript in Terminal
๐ฉโ๐ป Target Audience:
Freshers & Students learning backend
Working professionals revising Node.js basics
Anyone transitioning from frontend to full-stack
๐ What is Node.js?
Node.js is a JavaScript runtime that allows you to run JavaScript outside the browser, especially on a server.
๐ Normally, we use JavaScript in the browser (like in React or plain JS).
But with Node.js, we can use JavaScript to build:
Web servers
APIs
CLI tools
Backend logic (databases, file handling, etc.)
๐ง Why Node.js?
Hereโs why developers love Node.js:
โ
You can use the same language (JavaScript) on frontend and backend
โ
Itโs fast and event-driven, suitable for real-time apps (like chats)
โ
It has a huge ecosystem (via npm) for ready-to-use libraries
โ
Used by big companies like Netflix, PayPal, LinkedIn
๐ ๏ธ How to Setup Node.js on Your Computer
Step 1: Download Node.js
Visit: https://nodejs.org
Download the LTS version (Long-Term Support)
Install it like normal software (next-next-finish)
๐ก Node.js comes with npm (Node Package Manager) by default.
Step 2: Check Installation
Open your terminal or command prompt and type:
node -v
This will show Node.js version like:
v20.10.0
Now check npm:
npm -v
Youโll see something like:
10.5.0
โ๏ธ Writing Your First Node.js Program
Letโs create a simple program that prints your name.
Step 1: Create a File
Make a file called intro.js and write:
console.log("Hello from Node.js! My name is Payal.");
Step 2: Run the Program in Terminal
In terminal, go to the folder where intro.js is saved:
cd path-to-your-folder
Now run the file using:
node intro.js
โ Youโll see this output:
Hello from Node.js! My name is Payal.
๐ Congratulations! You just ran your first Node.js program.
๐ฏ Real-Life Example: Create a Calculator (Addition Only)
Let's say you want to create a backend tool that calculates the sum of two numbers.
Create a file called add.js:
const num1 = 10;
const num2 = 20;
const sum = num1 + num2;
console.log("The sum is:", sum);
Run:
node add.js
Output:
The sum is: 30
๐ In real life, backend logic like this can come from a form input (e.g. on a shopping website).
๐งฉ Key Concepts You Learned Today
| Concept | Description |
| Node.js | JS runtime to run code outside the browser |
| Terminal/Command Line | Used to run .js files directly using node command |
console.log() | Prints output in the terminal |
.js file | Normal JavaScript file used for scripting in Node.js |
| Real-life use case | Can be used in form handling, APIs, automation, etc. |
๐ Practice Tasks for Students
Create a file
multiply.jsto multiply two numbersWrite a file
bio.jsthat prints your name, age, and cityRun both programs using
node filename.jsin terminal
๐จโ๐ป For Working Professionals
Node.js enables you to:
Automate tasks (e.g., file processing, scheduling)
Build backend services quickly
Work with APIs and databases using a unified language (JS)
Integrate with frontend (React/Angular) smoothly in full-stack apps
โ Summary
๐น Node.js lets you run JavaScript on your system, not just browser
๐น It is lightweight, fast, and perfect for backend development
๐น You wrote and ran your first backend program
๐น Now youโre ready to build on this with file systems, servers, and databases!
๐ Stay Connected
If you found this article helpful and want to receive more such beginner-friendly and industry-relevant Node JS notes, tutorials, and project ideas โ ๐ฉ Subscribe to our newsletter by entering your email below.
And if you're someone who wants to prepare for tech interviews while having a little fun and entertainment, ๐ฅ Donโt forget to subscribe to my YouTube channel โ Knowledge Factory 22 โ for regular content on tech concepts, career tips, and coding insights!
Stay curious. Keep building. ๐

