Node JS – Introduction

Node.js is an open source, cross-platform runtime environment for server-side and networking applications. Node.js is becoming more and more popular as NodeJS applications are written in JavaScript, and can be run within the Node.js runtime on any operating system.

The main features of Node JS area:

Event-driven / asynchronous programming

Instead of retuning values for the functions and determining the program-flow,  you basically define functions that are called by the system when an interesting event occurs (event callbacks).

Events are executed by an event loop – it’s a continuous loop which performs event detection and event triggering.

Event-driven programming is a programming style whereby the flow is determined by the occurrence of events. Programmers register callbacks to be used as event handlers for events they are interested in, and the system invokes these handlers when those events occur. This model of programming has some advantages over the traditional blocking paradigm where, to scale, you have to use multiple processes or threads.
JavaScript is a powerful language, which is well suited for this style of programming, mainly because it has first-class functions and closures.

 

Majd Arbash

...

Leave a Reply