Node.js

Creating applications based on event-driven programming.

A platform that facilitates the execution of the JavaScript code outside of a web browser.

What exactly is Node.js?

Node.js is a platform that independently implements JavaScript functionality. This platform employs an API; that creates websites based on event-driven programming. Besides the ability to run JavaScript scripts in environments outside of a web browser, the platform provides plenty of modules, which actually represent an enormous set of programming tools.

Specification

  • Asynchronism. In the architecture of event-driven programming, the runtime environment of events is not specified. Events are rather handled whenever free resources are available. This results in more efficient use of sources as well as greater code separation and loose coupling
  • Unification of the code on both the client and the server side. Implementing the same programming language on both sides of the connection precludes much of the duplication of logic usually required in many cross-platform environments.
  • V8 – an open-source JavaScript engine originally created for Google Chrome. The engine doesn’t interpret JavaScript code in real-time, but instead compiles the source code into native machine code, which increases efficiency. Afterwards the optimization process takes place by eradicating dead code and using a branch predictor. The automatic memory management is handled by an efficient’ garbage’ collector.
  • npm – a package manager for the Node.js used to install the extensions. Node.js is expanding very dynamically – currently npm catalogs over 250 000 packages with no end in sight.

As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications. In the following “hello world” example, many connections can be handled concurrently. Upon each connection, the callback is fired, but if there is no work to be done, Node.js will sleep

This is in contrast to today’s more common concurrency model, in which OS threads are employed. Thread-based networking is relatively inefficient and very difficult to use. Furthermore, users of Node.js are free from worries of dead-locking the process, since there are no locks. Almost no function in Node.js directly performs I/O, so the process never blocks. Because nothing blocks, scalable systems are very reasonable to develop in Node.js.


Some examples of companies whose applications were written by use of Node.js


Netflix
Paypal
Trello
Linkedin
CapitalOne
yahoo!
Mozilla
Uber

If you want to find out more about Node.js or need a support in project which uses Node.js – write to us via the contact form.