Node JS – Part 2

Hi Friends,

Today in this section, will move a bit and install node js extension for visual studio. Now, one point to note here that this tool is an extension to visual studio, hence it won’t work with free edition of visual studio. you need to have license edition of visual studio for implementing the same. So, you need to download the extension from the link http://nodejstools.codeplex.com/. Now, once NTVS installation is done, then you can see the node templates in JavaScript section as shown below in the screen shot.

Now, all these templates are quite educational. you can easily grasp the meaning of each of these. So, for simple demo purpose lets get started with one console app demo.

Now, by default it produced me Hello world string. So, when i do F5, it will simply print Hello World on the console screen. Now, if you notice the command console.log which is essentially the same what we use to print messages in javascript console window.

Now, here since i am in visual studio i can get all sort of by default Visual Studio intellisense + since i am using Resharper, so i’ll get pretty mature intellisense to help me through while coding.Also, I can walk through the code and debug the same while running and inspect the values as well as shown in the below screen shot.

Now, i can also run this project using shell as shown below in the screen shot. What i’ll do, i’ll rt-click on the project and then say open command prompt here. Then I’ll use to node to execute my app.js file.

Also, visual studio in background will create the simple project file which is exclusive for node js project as shown in the below screen shot. Now, this is similar to csProj what we used to have whenever we create C# application.

I hope your are enjoying Node learning. In the next module we’ll explore other available templates. Till then stay tuned and Happy coding.

Thanks,
Rahul Sahay
Happy Coding