Skip to content

ShevchenkoOl/uvod-do-TypeScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installing and configuring the development environment:

  1. we will use Node.js to install and configure the development environment;
  2. install TypeScript using Node Package Manager (npm), which is automatically installed with Node.js: npm install -g typescript. This command installs TypeScript globally on your computer, allowing you to use it in any project;
  3. after installation, you can check the TypeScript version and its functionality using: tsc -v;
  4. to work with TypeScript, I recommend using Visual Studio Code (VS Code).

Now we have everything we need to get started with TypeScript! You can create a new TypeScript file with the .ts extension and start writing code.

test.ts

function add(num1: number, num2: number) {
  return num1 + num2;
}
add(1, 1);

Let's compile it in the console using the command:

tsc test.ts.

We have a js file next to the ts file:

screen folders

Let's open the js file:

file test.js

the contents of our ts file were overwritten by our js format.

We can also monitor file changes in real time by running the command: tsc test.ts -w or tsc test.ts -watch. In order not to stop npm start execution every time, you can open tsc -w in a separate console. Every time you save the file, it will be recompiled, if there is an error, you will immediately see it in the console.

Author

This repository was created and maintained by Oleksii Shevchenko. Questions, suggestions and feedback can be directed to email or linkedin profile. If you have any questions or suggestions, feel free to create an issue or submit a pull request.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors