Hey folks, are you searching tutorial for TypeScript download and installation on Windows 10 - if yes, then stay tuned with this article because in this article you will learn about How to download and install TypeScript on Windows operating system & at the end of tutorial we will also do a simple project i.e., Hello world in TypeScript - but before that let's take a TypeScript overview.
What is TypeScript?
TypeScript is modern programming language which is developed as an extension of JavaScript programming language. And TypeScript programming language also supports the JavaScript libraries. In 2012, Anders Hejlsberg designed and developed TypeScript programming language at Microsoft. TypeScript programming language is developed as a free and open source programming language and it was licensed under Apache 2.0 License. And anyone can download TypeScript programming language from its official website for free. TypeScript programming language is a pure object oriented programming language which is used to develop both side server and client server applications. TypeScript is a portable programming language which also supports the feature of error checking during compilation. TypeScript programming language is a compiled programming language as compiler is required to compile and convert the TypeScript codes into machine readable language.
Condition required to install TypeScript;
- Node.js package manager (npm).
- Integrated Development Environment (IDE) or text editor such as Eclipse, Visual Studio Code, etc.
NOTE: In this tutorial, we have used Visual Studio Code.
Now let's discuss how to download and install TypeScript on Windows PC.
How to download and install Typescript on Windows
Here, we will discuss step by step guide to download and install TypeScript on Windows operating system;
• Install Node.js first
You need to install node.js (npm) before installing TypeScript on Windows because node.js is the only way with which you can setup TypeScript on local computer. It is good to say that we have already published tutorial on node.js download and installation on Windows - just click it!!!
• Open Node.js command prompt and give command to download TypeScript
Now, go to windows menu and search for "cmd". After that, click on "Node.js command prompt" and open it.
To download TypeScript on your windows PC, just paste the following command on the command line and press "Enter" key.
npm install -g typescript
After doing this it will automatically download and install TypeScript on your Windows PC.
• Create a new TypeScript directory and print Hello world in TypeScript
Now, let's start creating a new application on TypeScript. For that, you have to create a new directory where your projects will be saved. To create a new directory - just open Windows Powershell then give the following command to start;
cd\
After that, type this following command to create a new directory for TypeScript project.
mkdir Typescriptbasics
After this, It will automatically create a directory named with "typescriptbasics"
Now, just give following command to open this directory;
cd\typescriptbasics\
It will open "typescriptbasics" directory in command line, Now to open this code in Visual studio just type code and press enter.
After doing this, Visual Studio Code application will automatically open on your Windows pc. Now, click on "Open Editor" and create a file name i.e., app.ts & just copy and paste this following code on editor
console.log("Hello World");
- after doing all this, press ctrl+s to save this file.
Now, to print Hello world in TypeScript just these following steps.
1. Copy the path where hello.ts file is saved - to get this path simple go to this pc > (C:) > typescriptbasics - copy this directory path!!
2. Go to command line, then just type the following command;
cd directory path
Note : Here paste the copied path instead of directory path.
3. Now, you have to compile the hello.ts file. For this, just paste the following command on command line;
tsc app.ts
And press "Enter" key. It's almost done!!
4. Now to run this "hello world" code - just type the following command on command line;
Node app
Now here you will see that hello world is printed successfully;
Conclusion
Above we have discussed the tutorial for TypeScript download and installation on Windows 10. TypeScript is modern programming language which is developed as an extension of JavaScript programming language. And TypeScript programming language also supports the JavaScript libraries. In 2012, Anders Hejlsberg designed and developed TypeScript programming language at Microsoft. TypeScript programming language is developed as an open source programming language and licensed under Apache 2.0 License. TypeScript programming language is a pure object oriented programming language which is used to develop both side server and client server applications. By following above mentioned steps anyone can easily download and install TypeScript on Windows operating system. I hope this information is helpful to you all.