Where, when and why we use Node.js

Where, when and why we use Node.js

1.What is Node.js?

Node.js is an open-source server framework. It’s completely free and used by a lot of developers around the world. Node.js is an open-source runtime environment for server-side and networking applications as well as is single-threaded. It uses the Google JavaScript V8 Engine to execute code

Node.js = Runtime Environment + JavaScript Library

Node.js is a platform built on Chrome's JavaScript runtime for easily fast and scalable network applications. Node.js library is very fast in code execution.

2. Why we use it? 

Node.js uses an event-driven, non-blocking I/O model which makes it lightweight and more efficient, perfect for data-intensive real-time applications that run across distributed devices.

3. File handling

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

Here is how Node.js handles a file request:

Sends the task to the computer's file system, ready to handle the next request as well.

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

4. What Can Node.js Do?

?Node.js can generate dynamic page content.

?Node.js can create, open, read, write, delete, and close files on the server.

?Node.js can collect form data.

?Node.js can add, delete, modify data in your database.

No alt text provided for this image

5. Who created Node JS?

Ryan Dahl 

He was born in 1981, an American Software Engineer and the original developer of the Node.js JavaScript runtime. In 2009, Ryan Dahl wrote Node.js.

Believe it or not, Node.js is 12 years old!

But, in comparison, JavaScript is 26 years old and the Internet is 32 years old. 

6. What are I/O operations nodes?

It's a short form of input/output, I/O refers primarily to the program's interaction with the disk and network of the system. Examples of Input / Output operations include reading/writing data from or to a disk, making HTTP requests, and talking to databases.

7. What is the difference between JavaScript and NodeJS?

No alt text provided for this image
No alt text provided for this image

8. Where to Use Node.JS?

Following are the areas where Node.js is proving itself as a perfect technology partner.

?I/O bound Applications.

?Data Streaming Applications.

?Data Intensive Real-time Applications (DIRT)

JSON APIs based Applications.

?Single Page Applications.

9. Is Node JS frontend or backend?

Node. js is a runtime environment that allows the software developers to launch both frontend and backend of web apps using JavaScript. 

Although JS carries all the processes for App assembly, as a backend development environment, Node.js differs from the frontend environment.

 /* Hello World! program in Node.js */console.log("Hello World!");

 10. Event loop:

Node.js registers with the OS so the Operating System notifies it of connections and issues a callback. Node.js runtime, each connection is a small heap allocation. Conventionally, approximately heavyweight OS processes handled each connection. Node.js uses an event loop for Extensibility, instead of processes or threads. In contrast to other event-driven servers, Node.js's event loop does not need to be called explicitly. Instead, callbacks are defined, and the server automatically enters the event loop at the end of the definition of callbacks. Node.js exits the event loop whenever no further callbacks to be performed.

No alt text provided for this image

11. Download Node.js archive

 Download the latest version of Node.js which is an installable archive file from Node.js Downloads. At the time of writing this tutorial, the following are the versions available on different Operating Systems.

No alt text provided for this image

12. Can you learn node js without knowing JavaScript?

If you have taken other programming courses before (like Python or C++) then you have the proper programming foundation and Obviously can go ahead and start learning Node.js without taking a JavaScript course.


Muhammad Azhar Rafique

Tech Lead | CEO & Co-Founder | Full Stack Developer | Bronze Medalist ??

3 年

Informative

Asif Rasool

Data Engineer at Bloomwell Group

3 年

Good work Usama. It is an amazing article. Zabardast

Huma Jamil

Doctorate Student

3 年

Informative ??

Abdul Jabbar

Data Scientist | Django Developer | Machine Learning | Deep Learning | Python

3 年

Great

要查看或添加评论,请登录

Usama Zafar的更多文章

社区洞察

其他会员也浏览了