Development / Open Source

Node.js Add-On Tooling for Visual Studio

2 Apr 2015 11:39am, by

Last week Microsoft announced the release of a set of Visual Studio add-ons for developers using Node.js. Currently available for Visual Studio 2012 and 2013, the Node Tools for Visual Studio (NTVS) can be used with the free Visual Studio Community tools, as well as with the commercial versions of Microsoft’s IDE.

NTVS comes with tools to build Express applications

NTVS comes with tools to build Express applications and to work with npm.

Licensed using the Apache 2.0 license, the tools and source code are available through Microsoft’s CodePlex repository, as is the ability to submit code and make pull requests. Installation in Visual Studio is quick and easy, and the tools are easily accessible once installed, with new menu items and new project templates. There are a couple of pre-requisites: if you’re planning on using Node.js or io.js support from the Azure web site, then you’ll need to install the Visual Studio Azure tooling, and of course you’ll need an up-to-date installation of Node.js on your development PC.

As NTVS is a Visual Studio add-on, it gets access to the complete Visual Studio IDE, including its syntax highlighting and automatic code formatting. There’s also code completion, as static analysis tools handle both code you’ve written and any npm packages you’ve installed. While there is support for io.js, it’s not complete as yet, as ECMAScript 6 is not yet fully supported in Visual Studio and the new language syntax causes issues with the IntelliSense code analysis tools.

Perhaps the most useful feature in NTVS is its interactive window. Like the sandboxed Swift playgrounds in Xcode, it lets you quickly try out code snippets using a local copy of Node.js before you add them to your applications. It’s a useful tool, not just as a scratchpad, but also as a way of isolating and testing code elements while debugging.

It’s debugging tools like this that make it a lot easier to use a full-fledged IDE like Visual Studio with Node.js. With hooks into its remote debugging tools and into its profiler, you can quickly come to grips with applications and determine production and performance issues. There’s also support for integration with Visual Studio’s unit testing tools and the Visual Studio Online devops services, including integration with Git and Github.

If you’re using a Node.js framework, the NTVS static-code analysis tools are tested against the 100 top npm packages, with the IntelliSense tools also tested in popular frameworks like Express and Seneca. Express users get the added benefit of built-in project templates, so you can quickly set up an Express-based site, with Visual Studio’s npm installer handling setup for you. There’s full support for npm, and dependencies are exposed and managed through the familiar Solution Explorer.

Microsoft’s NTVS tooling is a welcome addition to Visual Studio. With Node.js becoming increasingly important for microservice development, and for scalable containerized applications, giving developers the choice of using it in their Visual Studio projects makes a lot of sense. Combined with the free community edition of Visual Studio, it should give developers the ability to quickly get started with Node.js while using more than just a text editor. Combining NTVS with Xamarin in Visual Studio means you’ll have an end-to-end development tool, from service to cross-platform client.

We’ve found it a useful tool in the week we’ve been using it; NTVS removes much of the frustration around coding Node.js services by building it into a familiar IDE. With support for deployment services, and integration into a continuous delivery workflow it could make Visual Studio not just the home for your Windows apps, but also the microservices that drive them.

Feature image via Flickr Creative Commons.

A newsletter digest of the week’s most important stories & analyses.