Mr. Deepak Verma
Web Developer
Node Home

Learn Node JS by M-Learnify

Node JS

Node Home


What is Node.js?

Node.js is a free, open source tool that lets you run JavaScript outside the web browser.

With Node.js, you can build fast and scalable applications like web servers, APIs, tools, and more.

Tip: Sign in to track your progress.

What Can You Build With Node.js?

Node.js uses an event-driven, non-blocking model. It can handle many connections at once without waiting for one to finish before starting another. This makes it great for real-time apps and high-traffic websites.

  • Web servers and websites
  • REST APIs
  • Real-time apps (like chat)
  • Command-line tools
  • Working with files and databases
  • IoT and hardware control
How to Run Node.js Code

Save your code in a file, for example app.js, then run it in your terminal or command prompt with:

node app.js

This will start your Node.js program.

Example: Get Your Own Node.js Server

let http = require('http');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World!');
}).listen(8080);
        

Run this code with node app.js and visit http://localhost:8080 to see "Hello World!"

What is npm?

npm is the package manager for Node.js. It helps you install and manage third-party packages (libraries) to add more features to your apps.

Example: Installing a package

npm install express

Using Express in your code:


const express = require('express');
const app = express();

app.get('/', (req, res) => res.send('Hello World!'));
app.listen(8080);
        
Download Node.js

Download Node.js from the official website: https://nodejs.org

โ† Back to Courses
Course Lessons