Quantcast
Channel: Node.js Tools for Visual Studio
Viewing all articles
Browse latest Browse all 4630

Updated Wiki: TypeScript

$
0
0

 

TypeScript support

Starting with DevBuild “Feb 10, 2014”, NTVS includes preliminary support for TypeScript.   The build is available at https://nodejstools.codeplex.com/releases/view/116275.

Installation

To enable TS support, first install the TS package:

1. Go to http://www.typescriptlang.org/#Download

2. Click on “Download the plugin”.  Once you run the installer, you’ll enable TS for both VS2012 and VS2013.

3. Install the latest DevBuild from the NTVS Download page:  https://nodejstools.codeplex.com/releases/view/116275

4. Restart VS

Once both are installed, try File/New/Project and you should see TypeScript/Node.js :

clip_image001

You should Node.js under the TypeScript node.

Now hit F5 and you’ll see that the TS compiler has been kicked off:

clip_image002

This will result in corresponding JS files being generated (which should not be generally edited or used for debugging).  The .Net warning can be ignored or fixed by manually adding “ToolsVersion=4.0” into your njsproj xml root element.

clip_image003

Debugging

NTVS understands TS’s source maps (*.js.map) and provides the usual break, step in, out, conditional bkpoint, etc. support:

clip_image004

Intellisense

TS uses .d.ts files to provide intellisense support which can be used in NTVS full more accurate completions:

clip_image005

NOTE: This preliminary build ships with basic .d.ts files which only reflect a small portion of the available Node.js API.  We suggest that you grab the latest .d.ts files from DefinitelyTyped at:https://github.com/borisyankov/DefinitelyTyped. You can drop these files into your project and get better intellisense.

Profiling

There is currently no Profiler support for NTVS+TS.  We’ll add it in an upcoming build.


Viewing all articles
Browse latest Browse all 4630

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>