Nodejs Intro

what is nodejs?

Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast and scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

Node.js is an open source, cross-platform runtime environment for developing server-side and networking applications. Node.js applications are written in JavaScript, and can be run within the Node.js runtime on OS X, Microsoft Windows, and Linux.

Node.js also provides a rich library of various JavaScript modules which simplifies the development of web applications using Node.js to a great extent.

Simply we define it with a equation :

Node.js = Runtime Environment + JavaScript Library

How Nodejs works?

A new request coming in is one kind of event. The server starts processing it and when there is a blocking IO operation, it does not wait until it completes and instead registers a callback function. The server then immediately starts to process another event (maybe another request). When the IO operation is finished, that is another kind of event, and the server will process it (i.e. continue working on the request) by executing the callback as soon as it has time.

So the server never needs to create additional threads or switch between threads, which means it has very little overhead. If you want to make full use of multiple hardware cores, you just start multiple instances of node.js




Love podcasts or audiobooks? Learn on the go with our new app.

HTML5 Canvas Blend mode with globalCompositeOperation

A Practical Intro to the Linked List Data Structure (With JavaScript Examples)

The First 5 Principles of Object Oriented Design(SOLID), JavaScript, Version Controlling (Git)and…

How to copy composite data type by value i Javascript

Storing location data

Google Authentication using Hasura Backend Plus

Use Express.JS as a Web Server

StoryServer Public Alpha (or Early Beta) — v0.90.150 released 2019 March 2

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Md Piash

Md Piash

More from Medium

Node.js | What is Node.js? | Why Node.js? | Uses of Node.js