Hey What's going on guys welcome back to the channel
The IT Guy and today will be learning about the fundamentals of node JS now this is going
to be a series of videos where will be learning the concepts of node JS and learn how to code
in node JS so if you are new to my channel consider subscribing at the end of this video
if you are interested in the upcoming videos as well also this video is for complete beginners
who have no idea or a little bit idea of node JS and also for those developers who have
little experience in node JS and want to brush up the skills in it so as far as the prerequisites
are concerned I will say that you must have a basic knowledge of JavaScript I'm not asking
that you have to be a pro in it but you must have a basic knowledge about it like how to
declare variables and all that stuff DOM manipulation and all that now actually I am also thinking
to start a simple crash course of JavaScript where I'll quickly teach you how to work on
Javascript and how to do DOM manipulations and all that stuff so if you're interested
in that tell me about it in the comment section and we will see that video comes up soon Now
let's start with node JS so now what is node JS node JS is basically JavaScript running
on the server side now for years JavaScript was thought as a client side language that
only runs in the browser which actually made it fast but also extremely limited and it
was used for improving UI's, making sliders, animations, validation on client side and all
that stuff but now it can be done on the server side by node JS and it is built on Chrome
V8 JavaScript engine which is extremely powerful and in my opinion Chrome is the best browser
now your thoughts might be completely different and there's nothing wrong in that but in my
opinion Chrome is the best browser that I have used and its build on that no no just
can be used to build fast and scalable web application and node JS uses an event driven
non blocking IO model which makes it lightweight an efficient now it's completely fine if you
don't understand the last line because we will be seeing about it further in this series
of videos so let's get over it so now let's talk about the non blocking IO model of node
JS which is one of the most important advantage or I would say 'The' most important advantage
of node JS well lets first talk about some other server side Technologies like PHP or
Ruby On Rails many others so let's take example of PHP here so when you build a PHP application
on any server like Apache Server the each connection or the request that you make to
the server spawns a new thread which takes off the system memory and it will eventually
Max out whatever the maximum memory load handles so basically it needs to wait for one process
to finish before it starts the next one and this works in a 'synchronous' manner but for
node JS it works on a single thread and it works on 'asynchronous' manner so it can support
tens of thousands of concurrent connections at once so because of this it optimises the
throughput and scalability now that's the reason why node JS apps are extremely fast
and efficient now if you still have some other doubts in your mind then its ok it happens
if a starting a new language once you start working on this languages you will get to
it how this things work so moving head node JS uses something called as the event loop
so node JS runs on single thread which we have discussed before so it supports concurrencey
via events and callbacks so it uses an event Emitter class which is used to bind events
and event listeners so now if you look at the diagram you will get a bit more idea about
the event loop so every new task is handled by the event loop it binds the event and event
listeners to it so once the process of execution is completed then it returns a complete call
back and because of which the next process goes into execution so this whole complete
process is done by the event loop and if it still sounds gibberish to you then just keep
this in mind that other Technologies like PHP uses synchronous call while nodeJS works
on asynchronous which makes it more faster than them and it uses events and callbacks
to handle the execution so now let's take a look at the things that we can build using
node JS so you can create real time services like chat box games using socket.io which
we'll be seeing it it's a really popular module used in node JS and you can create CMS social
application Blogs with node JS you can also create rest API and other back end applications
basically can build anything that is not CPU intensive and if you are really thinking of
starting some new language then I really suggest that node JS is the language you should be
looking forward to so moving ahead what is npm so in the next video will see the installation
process so when we install node npm is also installed so npm is basically node JS package
manager it is used to install other modules and packages in node application and all the
modules that you will install they will get stored in a node_modules folder so that's
basically a brief idea what and NPM is next let's see about the popular node JS module
so first is electron it's really popular and it is used to build cross-platform native
web applications using HTML CSS and JavaScript now in simple words if I say that you can
use Web Technology languages like HTML CSS and build desktop applications on any platform
it can be Windows Mac or Linux you just have to code it once and you can compile it all
the three platforms so it's really popular nowadays second we will talk about is Express
it is a backend Framework for web development we will be seeing how to use Express in further
videos next socket.io which is a server-side component for websockets as I mentioned earlier
it it can be used to make that chat box which is really a real time application so next
is connect it is an extensible HTTP server Framework which is a baseline for Express
next is mongo or mongoose this of wrappers to interact with mongo DB database now mongo
DB is a no SQL database and the reason why mongo DB is more popular because it is more
compatible with node but its not like you can use only mongo DB database node JS has
support for my SQL sq Lite postgresql so you can use other database is as well but mongo
DB is more preferred by developers because it is more compatible with node JS so next
is coffeescript so we have copy script compiler which is basically a superscript of JavaScript
too many scripts and next we have Pug which is new name for Jade if you heard about it
it's an Template engine used in node you can imagine it like HTML if you just google it
you will see the syntax of it is mostly similar to HTML So ya these are some of the popular
module in node JS and in further videos we might be seeing how to use this module in
code so I hope you will enjoy watching those tutorials as well so saying that this completes
our tutorial for the introduction to node JS I hope I haven't lost you in the middle
so in the next video we'll be seeing how to install node JS and do basic programming in
it so press the bell icon to get notification if you haven't subscribe to my channel and
I'll see you next time bye bye
No comments:
Post a Comment