Node.js Web Development
Tas.co.in
Built on Google’s V8 JavaScript engine Node.js is a runtime JavaScript environment and is written in C, C++ and JavaScript. It is used for the development of server-side scripting and networking applications. It is free and can run on various platforms such as Windows, Mac OS, Linux, etc.
Tas.co.in
Why Developers Prefers Node.js For Web Development • Speed It increases the speed of code execution • Single-Thread It uses single-thread for receiving the connection requests and the tasks from those requests are passed on to the background threads to be handled. It cannot be used for CPU intensive operations as it works on the concept of single thread. • Data Form It produces the results in the form of data streams rather than buffering it.
Tas.co.in
No. of Requests It is unlike the traditional servers and can complete higher number of requests. Open Source It is open-source and licensed by Massachusetts Institute of Technology(MIT). Lightweight It is lightweight and includes very few modules. One can add other modules as per the requirement of their application.
Tas.co.in
Node.js Execution and Development The traditional web-servers use multiple thread for processing a client request and if all the threads are busy executing client requests then the new client has to wait for one of the threads to get free. Whereas Node.js uses libuv library to perform threading using a single thread, this makes it use less resources in comparison to other traditional web-servers. But at times, when there are requests which become heavy to process, the single thread may get blocked and that leads the client to face problem as the requests will be stopped until the heavy process is completed. This problem needs to be managed in Node.js. Tas.co.in
An event takes place when there is change from one state to another, for example when an icon is clicked using a cursor an event occurs which makes the program run. Node.js uses the event-driven architecture which is able to perform non-sequential I\O. One of the concepts of Node.js is module. Modules are collection of functions that can be inserted inside an application you are building. It can be said that they act like JavaScript libraries. It can be of two types, built-in modules or user created modules. Tas.co.in
Tas.co.in