>> Hi, everyone, I'm Yo.
In this video I will show you how to setup VS Code on
your machine and configure it for developing Node.js application.
First to install VS Code,
you need to open a browser and go to code.visualstudio.com.
You will end up on this webpage,
and from there you just have to click on ''Download'' to get
the setup file for your operating system. For me it's Mac.
Once the download is finished,
open the setup file
that has been downloaded and just follow the instruction.
I'm not going to show that because it's different,
depending of the operating system you're using.
Once you're finished installing VS Code, open it,
and I will show you the best extension
for developing Node.js application.
I've selected this five extension to get started with,
of course, you can always add some other later.
But if you're looking to get started with Node.js,
from my opinion these are the bare minimum
to be efficient while developing Node.js application.
The first one I wanted to show you is npm Intellisense.
This extension does a lot of thing regarding npm,
but my favorite one is to be able to quickly
generate code for importing libraries in your code.
Let me show you. When you start developing a new application,
probably you will want to import some package.
From there, I can open the VS Code
command palette and search for npm Intellisense import module.
Once I've selected that,
it will automatically list
all the packages I've already installed in my project.
From there, you can just choose one and pick other one,
and it will generate the cut for the imports.
It's not much but it can save you a lot of time.
Another one I've wanted to show you is this ESLint extension.
ESLint is a tool that you will probably
use in all your Node.js project because
it will save you a lot of time
avoiding you to make silly mistakes.
For example, if I take this code here,
you can see there's some issues already detected,
like the fact that I did not define this variable.
You can also open
the problem window and see
all the problems that exist in your project.
Once I fix the issue,
and there all problems are gone.
The next extension is Prettier.
Prettier is a code formatter,
and that will guarantee you that whoever is
writing the code it will always be formatted the same way.
I go back to my code here,
open the command palette and choose Format Document.
The first time it will tell me to
choose between multiple formatters.
If I click on "Configure"
I can choose Prettier from there,
and then you can see that it has
automatically reformatted my code.
It is really important to have some formatter in a project to make
sure you have a consistent cut style across all your files.
The next extension I wanted to show you is
called Document This, because trust me,
you will want to put at some point comments in
your code to make sure that everyone,
and that includes you, understand what was written.
I go back to my code here.
If you type in a special command that start with two stars we,
by default, are the exemption to generate
the templates using this extension.
It will generate a special documentation template
based on JSDoc formats.
You can see that there's params and returns,
it's a format to declare exactly what type of parameters,
what does it return,
and you can give a short description,
and even, you can document all the function works if needed.
If you add these special commands everywhere in your code,
you will be able to extract them and use the JSDoc tool to
generate a proper HTML documentation from the source code,
and that's pretty useful.
The last extension I wanted to show you is called REST Client.
It's mostly useful if you're developing web APIs with Node.js.
In my current application,
I have a web server running.
If you go back to files and create a file that ends up with .HTTP,
it's a special file, and in there,
you can just type in some request.
Let me hits my localhost several that is running on 3,000
here. You can see that I have this send request button.
Once I click on this button,
it will just send a get request by default in this server.
You can see that I've received the response here.
Knowing this special HTTP file,
you can also put in multiple requests.
For example, I can add POST requests,
I can add in special headers here,
I can add also a JSON body to my request.
If I send this one,
you can see that I get a different result from my application.
It's very useful because you can put request for
your wall HTTP API in a single file,
include it in your repository,
and share it with all your co-workers, and that's it.
With all these extension you should be more than
ready to write your Node.js application.
See you in the next video to learn more about Node.js.