How was Node js developed

What is Node.js?

Use other modules

In addition to the http module, Node.js contains a few other modules, for example for the implementation of TCP / IP-based servers, access to the file system or the processing of streams. A list of all included modules and their description can be found in the documentation of Node.js./p>

In order to inform the web browser that the returned content is not pure text but an HTML file, the content-type header must also be transmitted. The writeHead function is used for this and, like the write and end functions, is also available on the res object:

Node.js is accompanied by an exceptionally active community that has already developed numerous additional modules in recent years. Several modules are now available for almost every application. The bandwidth ranges from the connection of databases to communication based on various protocols to video and audio programming.

This entire fund is managed with the help of npm (Node.js Package Manager). However, it is problematic to first gain an overview of the currently around 40,000 modules.

Unlike in the web browser, Node.js does not execute the JavaScript code within a sandbox, so that one has extensive access to the underlying system. This allows Node.js to be used not only for developing web applications, but also, for example, as a replacement for Bash or PowerShell scripts.

Strengths and weaknesses

The greatest strength of Node.js is the ease with which it can be programmed to create highly scalable applications in a language that any web developer is familiar with. However, Node.js can only develop its true potential if a lot of I / O accesses are actually carried out. Node.js is also particularly suitable for implementing push services, for example based on web sockets.

Another interesting aspect of Node.js arises from the use of JavaScript: Many REST-based web services nowadays use JSON - a data format that JavaScript can natively handle. Therefore, Node.js is particularly suitable for developing such services, especially in connection with a NoSQL database that also speaks JSON.

Nevertheless, Node.js is not equally suitable for all scenarios: If an application is hardly based on I / O access, but rather on extensive, CPU-intensive calculations, Node.js is largely unsuitable. So here it is important to weigh up from case to case.

Conclusion

Node.js is an extremely interesting technology that allows you to develop complex and very scalable web applications with just a few lines of code. The use of JavaScript enables web developers to get started easily and without problems.

The challenge with Node.js is not to master the (relatively small) core, but to get to know the extensive ecosystem. This only works with time and patience - or with appropriate guidance from a developer who is already experienced in Node.js.

Anyone who deals with the development of I / O-heavy web applications, web-based push services or REST web services is well advised to take a look at Node.js.