Advertisement

Responsive Advertisement

Node.js

 1.What is Node.js?

  1. Node.js is an open source server environment
  2. Node.js runs on various platforms (Windows, Linux, Unix, Mac, etc.)
  3. Node.js uses JavaScript on the server

2. Why should we use Node.js?

Node.js uses asynchronous programming (Asynchronous programming is like giving instructions for things that take time without having to wait around for them to finish. Imagine you’re baking cookies and doing laundry at the same time) in a simple ex This approach makes programs faster and smoother because they aren’t stuck waiting for one task to finish before moving on to the next. 

A common task for a web server can be to open a file on the server and return the content to the client.

Here is how PHP or ASP handles a file request:

First Sends the task to the computer's file system. Waits while the file system opens and reads the file.

Returns the content to the client and Ready to handle the next request.by this way PHP or ASP handle a file request.


Here is how Node.js handles a file request:

First sends the task to the computer's file system. Ready to handle the next request.

When the file system has opened and read the file, then the server returns the content to the client.

Node.js eliminates the waiting, and simply continues with the next request.BY this way Node.js work.


3.What type of work can Node.js Do?

  1.  Generate dynamic page content
  2.  Create, open, read, write, delete, and close files on the server
  3.  Collect form data
  4.  Add, delete, modify data in your database these work done by Node.js

4.What is a Node.js File?

Node.js files contain tasks that will be executed on certain events

A typical event is someone trying to access a port on the server

Node.js files must be initiated on the server before having any effect

 extension ".js"

5.How we can download Node.js?

1st go to the official website of:  https://nodejs.org.

LTS (Long-Term Support): Recommended for most users and for stability.

Click on the version you prefer (typically, LTS is best for most people) to start the download. 


After Downloading the Node.js time to install.

Open the downloaded file (it's usually an .msi on Windows, a .pkg on macOS)

and follow the installation wizard:

 For windows and macOS: Follow the on-screen instructions, accepting the license agreement, selecting the installation path, and completing the setup. It will also install npm (Node Package Manager), which   helps you manage packages.


Step 3: And the last Verify the Installation

You can open terminal or command prompt.

Type node -v commands to check if Node.js and npm were installed successfully after this display the version o node js installed



















Post a Comment

0 Comments