Node-js
GraphQL Tutorial: What is GraphQL? Learn with Example
What is GraphQL? GraphQL is an application layer server-side technology which is developed by...
The modern web application has really come a long way over the years with the introduction of many popular frameworks such as bootstrap, Angular JS, etc. All of these frameworks are based on the popular JavaScript framework.
But when it came to developing server-based applications, there was a kind of void, and this is where Node.js came into the picture.
Node.js is also based on the JavaScript framework, but it is used for developing server-based applications. While going through the entire tutorial, we will look into Node.js in detail and how we can use it to develop server-based applications.
Lesson 1 | Download & Install Node.js — How to Download & Install Node.js and NPM on Window |
Lesson 2 | Node.js Modules — Create, Publish, Extend & Manage |
Lesson 3 | Create HTTP Web Server in Node.js — Complete Tutorial |
Lesson 1 | Node.js Express FrameWork Tutorial — Learn in 10 Minutes |
Lesson 2 | Node.js MongoDB Tutorial — A Complete Guide with Examples |
Lesson 3 | Node.js Promise Tutorial — A Complete Guide to the JavaScript Promises |
Lesson 4 | Bluebird Promises Tutorial — A Complete Guide to the Bluebird Promises |
Lesson 5 | Node.js Generators — What is, Callbacks vs. Node.js Generators |
Lesson 6 | Node js Streams Tutorial — Filestream, Pipes |
Lesson 7 | Node.js Unit Testing Tutorial with Jasmine — A Complete Guide |
Lesson 8 | GraphQL Tutorial — What is GraphQL? Learn with Example |
Lesson 1 | GraphQL vs REST — What's the Difference? |
Lesson 2 | Node.Js Vs AngularJS — Know the Difference |
Lesson 3 | Node.js Vs Python — What's the Difference? |
Lesson 1 | Node.js Interview Questions — Top 25 Node.js Interview Questions and Answers |
Lesson 2 | Node.js Tutorial PDF — Download Node.js Tutorial PDF for Beginners |
Node.js is an open-source, cross-platform runtime environment used for the development of server-side web applications. Node.js applications are written in JavaScript and can be run on a wide variety of operating systems.
Node.js is based on an event-driven architecture and a non-blocking Input/Output API that is designed to optimize an application's throughput and scalability for real-time web applications.
Over a long period of time, the framework available for web development were all based on a stateless model. A stateless model is where the data generated in one session (such as information about user settings and events that occurred) is not maintained for usage in the next session with that user.
A lot of work had to be done to maintain the session information between requests for a user. But with Node.js, there is finally a way for web applications to have real-time two-way connections, where both the client and server can initiate communication, allowing them to exchange data freely.
We will have a look into the real worth of Node.js in the coming chapters, but what is it that makes this framework so famous. Over the years, most of the applications were based on a stateless request-response framework. In these sort of applications, it is up to the developer to ensure the right code was put in place to ensure the state of web session was maintained while the user was working with the system.
But with Node.js web applications, you can now work in real-time and have a 2-way communication. The state is maintained, and either the client or server can start the communication.
Let's look at some of the key features of Node.js
Asynchronous event-driven IO helps concurrent request handling – This is probably the most significant selling point of Node.js. This feature basically means that if a request is received by Node for some Input/Output operation, it will execute the operation in the background and continue with processing other requests.
This is quite different from other programming languages. A simple example of this is given in the code below
var fs = require('fs'); fs.readFile("Sample.txt",function(error,data) { console.log("Reading Data completed"); });
Node.js is used by many large companies. Below is a list of a few of them.
Node.js is best for usage in streaming or event-based real-time applications like
Node.js is good when you need high levels of concurrency but less amount of dedicated CPU time.
Best of all, since Node.js is built on javascript, it's best suited when you build client-side applications which are based on the same javascript framework.
Node.js can be used for a lot of applications with various purposes. The only scenario where it should not be used is where there are long processing times, which is required by the application.
Node is structured to be single-threaded. If an application is required to carry out some long-running calculations in the background, it won't be able to process any other requests. As discussed above, Node.js is used best where processing needs less dedicated CPU time.
What is GraphQL? GraphQL is an application layer server-side technology which is developed by...
In this tutorial, we are going to learn about Generators and their differences with Callbacks What...
Bluebird is a fully-featured Promise library for JavaScript. The strongest feature of Bluebird is...
Testing is a key element to any application. For Node.js, the framework available for Testing is...
In previous tutorials, you would have seen callback functions which are used for Asynchronous...
What is GraphQL? GraphQL is an application layer server-side technology which is developed by...