TypeScript, node.js development with Visual Studio 2012 express

stonedmind picture stonedmind · Nov 6, 2012 · Viewed 8.1k times · Source

How can I write, build and run a node.js app in Visual Studio? I install the TypeScript extension on VS and the node.js package. When I create new project of type TypeScript it is only able to write script for browsers only.

Update

I want autocomplete and error handling for node.js libraries

Answer

Fenton picture Fenton · Nov 6, 2012

You need to include a type definition for node.js.

This file declares all of the operations for node.js so you can get auto-completion and type safety.

/// <reference path="./node.d.ts" />

var x = new SlowBuffer(5);