TypeScript Installation

TypeScript can be installed in two ways:

  • Via npm (Node.js package manager)
  • Install TypeScript's Visual Studio plug-ins

The good news, Visual Studio 2015 and 2013 (with Update 2) by default support TypeScript. If you haven't installed TypeScript yet for your Visual Studio, you can download it now from here.

When you visit here, you will find different plug-ins are available here for different Visual Studio versions. Some other plug-ins are also available here, if you are using other tools like Eclipse, Vim or Atom etc.

Other than above plug-ins, command-line TypeScript compiler is also available and can be installed as a Node.js package.

To install TypeScript:

npm install -g typescript

If you're using one of the supplied IDEs or editors, then you won't have to do this step, but it is good to know. You can compile a TypeScript file to a JavaScript file with the following command.

To compile:

tcs helloWord.ts

See TypeScript in Action here:

TypeScript Example

class Customer {
	Name : string;
	constructor (firstName: string, lastName: string)
		this.Name = firstName + "  " + lastName;
		return "Hello, " + this.Name;
let cust = new Customer("Jimi","Scott");

let button = document.createElement('button');
button.textContent = "Display Full Name";
button.onclick = function() {
Try it Yourself

TypeScript With Visual Studio 2015