TypeScript is a strongly typed programming language.It is superset of javascript.This means that it provides additional features not available in javascript.This includes features such as strong typing and type annotations.
To create TypeScript applications we can either use the Visual Studio IDE or use any other IDE. Following are the ways to install typescript:
Using Visual Studio 2015
If we are using Visual Studio 2015 then it is already a template provided for creating typescript applications.
Using Visual Studio 2013
If we are using Visual Studio 2013 then we can install TypeScript plugin.Once installed we will be able to create TypeScript applications from within Visual Studio.Follow the below steps to install typescript plugin for visual studio:
Go to the following URL http://www.typescriptlang.org/#Download
click the download button
Select Visual Studio 2013 in the list of options
Once the plugin is downloaded click on the TypeScript exe to install
Installing TypeScript as a Node.js package
As a Node.js package
Another option to install TypeScript is as a Node.js package using the following npm command
npm install -g typescript
If we are using Visual Studio then when we run the TypeScript application it is automatically compiled.If we need to manually compile the TypeScript application then we can use the following command
tsc helloworld.ts
tsc is TypeScript compiler and it generated javascript file from the TypeScript code.
Leave a Reply