Node.js is a free software and event platform in JavaScript oriented to network applications that must be able to scale up.
It uses the V8 virtual machine and implements the CommonJS specifications under MIT.
Node.js contains an integrated HTTP server library, which makes it possible to run a web server without the need for external software like Apache or lighttpd, and to better control how the web server works.
Concretely, node.js is a low-level environment that allows you to run JavaScript either in the web browser or on the server.

Node.js is more and more popular as a server platform, it is used by Groupon, SAP, LinkedIn, Microsoft, Yahoo !, Walmart, Rakuten, Sage and PayPal

Technical aspects

Competition

Node.js works with an evaluation model of a single executing thread using asynchronous entries and outputs that can run simultaneously on several up to hundreds of thousands, without incurring costs associated with contexto.6 This change Design Sharing A single execution thread among all requests meets the needs of highly competitive applications, in which each operation that performs inputs and outputs must have a callback function. A disadvantage of this approach is the single runtime thread that Node.js requires cluster7 scales additional modules the application with the number of processing cores of the machine on which it runs.

V8 is the runtime environment for JavaScript created for Google Chrome. It is a free software since 2008, it is written in C ++ and compiles the source code JavaScript in machine code instead of interpreting it in real time.

Node.js contains libuv to handle asynchronous events. Libuv is a layer of abstraction of network and file system functionality in Windows systems and POSIX-based systems such as Linux, Mac OS X and Unix.

The basic operations body of Node.js is written in JavaScript with support methods written in C ++.

Modules

Node.js incorporates several basic "blocks" compiled into the binary itself, such as the network module, providing an asynchronous network programming layer and other basic modules, such as Path, file system , buffer, and more general timers Stream. It is possible to use modules developed by third parties, either in the form of precompiled files ".node", or in the form of javascript files flat. Javascript modules are implemented according to the CommonJS specification for modules, 8 using an export variable to give these scripts access to the functions and variables implemented by the modules.9

Third-party modules can extend Node.js or add a level of abstraction, various middleware implementation utilities for use in Web applications, such as connection frameworks and express. Although the modules can be installed as individual files, usually installed using the Node Manager (NPM) package that will facilitate compilation, installation and update management packages and dependencies. In addition, modules that do not install the default directory for Node modules will need to use a relative path to find them. The Node.js wiki provides a list of several available third-party modules.
Uniform development between client and server

Node.js can be combined with a document database (eg MongoDB or CouchDB) and JSON environment to develop a unified JavaScript development. With the adaptation of server-side development patterns such as MVC and MVP, MVVM, etc. variants. Node.js makes it easy to reuse code from the same interface model between the client side and the server side.

Event Loop

Node.js is registered with the operating system and whenever a client establishes a connection, a callback is executed. Within the Node.js runtime environment, each connection receives a small allocation of dynamic memory space without having to create a thread ejecuciĆ³n.10 Unlike other event-driven servers, loop event management Node .js is not explicitly called but is enabled at the end of each execution of a callback function. The event management loop is complete when there are no more events to participate.

Three points are reflected in this code:

  1.  a module charger
  2. the native presence of an HTTP library
  3. the asynchronous aspect of language

Historical

Node.js was created by Ryan Dahl in 2009. Its development and maintenance are done by the company Joyent (en). Dahl had the idea to create Node.js after watching the progress bar of a file upload in Flickr: the browser did not know what percentage of the file was loaded and had to send a request to the web server. Dahl wanted to develop a simpler method. Ruby's Mongrel web server was another source of inspiration for Dahl. Dahl had failed in several projects in C, Lua, and Haskell, but when the V8 engine was released he became interested in JavaScript. Even though his original idea was to use non-blocking inputs and outputs, he will come back to this in his system module because it caused problems loading external libraries.

Node.js is used at the heart of the Palm webOS operating system.

Forks

At the end of 2014, in disagreement with the role of the company Joyent, several of the main developers of node.js decide to forker this one and then creates io.js. A year later, they decide to merge again with node.js.

In August 2017, node.js is forked again and several contributors create ayo.js

Frameworks for Node.js

    Express
    kraken.js
    Hapi.js
    Koa.js
    TotalJS
    Locomotive
    TWEE.IO
    Flatiron
    diet.js
    SailsJS
    Nodal
    Adonis
    Trails
    Strapi
    RhapsodyJS
    Compound.js
    ThinkJS
    Geddy
    Meteor
    DerbyJS
    GeddyJS
    TowerJS
    Mean.js and Mean.io
    Mojito
    Feathers
    Keystone
    Knockout.js
    SocketStream
    seneca.js
    Catberry
    AllcountJS.
    Flatiron
    Connect
    Socket.IO
    Noda
    RESTify
    Frisby
    Partial.js
    raddish
    Fortune.js
    percolator
    Ionic
    Devisjs

https://nodejs.org/en/download/

Younes Derfoufi
One thought on “Introduction to Node JS”

Leave a Reply