Some of the Node.JS features are:
1. All APIs in Node.JS libraries are asynchronous (non-blocking) and event-based. They do not have to expect a particular operation to provide a result; after a particular method has been invoked, it goes on, with a notification mechanism indicating when the operation has been completed and can provide data by calling a callback method in which the information obtained is processed further.
3. Although they only use one thread, the applications developed using Node.JS are scalable and can handle a much larger number of competing applications than traditional HTTP servers thanks to the mechanism of event notification; so the response time is low and the availability of the large server, since data waiting is eliminated.
4. Does not use memory buffers, but provides the data gradually.
Therefore, Node.JS platform is a Web application solution that uses intensive, real-time incoming/outgoing (streaming) web-based applications for Web applications using JSON-based APIs or web applications whose content is included in a single Internet page. It is not recommended that Node.JS be used for web applications that perform numerous processing tasks as it can affect performance.
For Linux, NodeJS can be installed either from the distribution repositories (using apt-get or yum) or by compiling the source on the NodeJS page. We recommend installing by compiling because versions of repositories are old.
For compilation, download the sources on the NodeJS page. You need GCC, g ++, make, OpenSSL, python installed.
The compilation is done using the following commands:
sudo make install
As you can see, one of the commands needs a privileged user. If you do not have this, you can install NodeJS in your local account:
./configure –prefix = ~ / local
This will have a local directory in the user directory where NodeJS will be installed. To work, you need to add a search path to the executable files of NodeJS. For this, add the following line to the ~ / .bashrc file:
export PATH = $ HOME / local / bin: $ PATH
NodeJS is just the compiler and a few libraries for programming. To add functionality, you need to install additional libraries. This is done using the npm command. The syntax is the following:
npm [-g] install library_name
Installing libraries is done in a directory called node_modules. This is either the global directory of NodeJS (if the -g parameter is specified) or in the current directory.
NodeJS is just the compiler, so you need another program to write programs.
You need a terminal to run the software. NodeJS is similar to Python in this sense. A program starts by using the command: