Build Node.js Apps Using Visual Studio 2013

Build Node.js Apps Using Visual Studio 2013

There is some good news for Visual Studio enthusiasts looking to develop web applications using Node.js. The Visual Studio team (with help from the community contributors) recently released the support for Node.js in Visual Studio 2013. While this is still in beta, and you may face issues while developing apps, it is definitely worthwhile to explore the features now and provide feedback to the team.

You can down the Node.js Tools for Visual Studio (NTVS) from CodePlex here. Follow the steps in the installation wizard to setup NTVS.

Once you have successfully installed the tools, you will see a bunch of templates showing up in the New Project Dialog under the Node.js section below JavaScript.

The predefined templates help you create a New Node.js Web Application, a New Azure Website built using Node.js, and a Worker Role with support in Node.js for creating long running processes using Node.

Note that Node.js is already supported by Azure Mobile Services and you can directly run Node.js scripts from Azure Mobile Services by configuring them in the Azure portal.

You can also create a project from existing Node.js code (which is likely to be the case if you were already developing on Node.js).

Select the “From Existing Node.js code” template. The dialog will launch a wizard to let you select the folder where your Node.js project is placed. It will enlist the Node.js start-up file if it finds one like the screenshot shown below:

(It is a good option to select “Exclude node modules”, since they will unlikely to be your start-up app).

You are all set, but when you build your project, it is most likely to fail, since the node modules will not be present or correctly referenced. Right click on the project and use the “Open Command Prompt Here” command to launch the command prompt and use the “npm install” command to install the node modules.

The NTVS tools also provide a nice option to manage and install global node modules. In your solution structure, expand npm and click Manage Node Modules from the Global Modules context menu. The module manager dialog will be launched where you can search and install global node modules.

You are now all set to start developing your Node.js project from within Visual Studio 2013. Since this is built on the underlying V8 JavaScript engine, you can leverage the power of debugging JavaScript applications seamlessly. You also benefit from the usual Visual Studio IntelliSense features for JavaScript. In future posts we will explore more regarding the debugging and deployment aspects, and look at creating a worker role with Node.

Share the Post:
XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes

ransomware cyber attack

Why Is Ransomware Such a Major Threat?

One of the most significant cyber threats faced by modern organizations is a ransomware attack. Ransomware attacks have grown in both sophistication and frequency over the past few years, forcing

data dictionary

Tools You Need to Make a Data Dictionary

Data dictionaries are crucial for organizations of all sizes that deal with large amounts of data. they are centralized repositories of all the data in organizations, including metadata such as