- Go to https://nodejs.org/
- Download the installer you wish to install.
- Run the installer
- To verify that we have installed TypeScript successfully, type in the following in powershell:
tsc --version - Open Visual Studio Code
- Add a TypeScript configuration file (tsconfig.json) to the folder. A sample TypeScript config file can be found on the Visual Studio Code site: https://code.visualstudio.com/docs/languages/typescript
- Now let's add a Type script file, add a HelloWorld.ts file
- Place in the following code:
export class HelloWorld {shout() {console.log("hello world");}}
let helloWorld = new HelloWorld();helloWorld.shout(); - Click on Task -> Run Build Task
- Select tsc: build - tsconfig.json
Open windows powershell, go to file folder and type in the following:
node helloWorld.
Friday, September 22, 2017
TypeScript Setup for Visual Studio Code
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment