Hi all, in this chapter I will give you the short explanation and simple example of the functionality of Node.js in web develepoment activites that most liked by many developers in whole of the world. Are you interested? So, please enjoy!
· Asynchronous And Event Driven: All APIs of node.js library are non-blocking (asynchronous). It means a Node.js based server never waits for an API to return data.
· Very fast: Node.js library very fast in code excetution and effective.
· Single Threaded But High Scalable: Node.js uses a single threaded program and the same program can provide service to a much larger number of request than traditonal servers (ex: Apache HTTP Server).
· No Bufferring: Node.js applicatons never buffer any data.
· Licence: Node.js released under MIT License.
The Simple Example
For this example, I will create the simple example from Node.js it just for make you understand about the workflow of Node.js. So, following are the requirements you must be prepared:
· Node.js to run the program by opened the Node.js command prompt to execute it that contained a bundle of node package module (NPM). In this chapter I use Node.js version 8.11.11. You can download the latest version of Node.js in the following link: https://nodejs.org/en/download/. And then install it by followed the instructions.
· Text editor, in this example I use Atom text editor for writing a series of code. But, you can use the other text editors like Notepad++, sublime, Visual Studio Code, and etc.
· Browser, in this example I use Google Chrome to perform the program. But, you can use the other browsers as you want to.
Following the result of the code:
Running program in NPM:
The Result of The Program:
So, this is the end of this chapter. For more detail about the installation and code of Node.js, I wil tell you about that in the next chapter. Thanks for the attention, have a greet weekend and see ya! :)