Running a TypeScript program in Visual Studio Code | VS Code Tutorial for Beginners
Hello Friends,
In this tutorial session, we will learn to set up a Typescript programming environment in visual studio code. Also, we will learn to create and compile the first typescript program in visual studio code and we will learn to set up the 'tsconfig.json' file to generate all compiled files in a given folder.
Here are the steps:
In the following steps, we will learn to set up Visual Studio Code to run TypeScript program.
Note: Node.js must be installed.
Step 1: Very first we need TypeScript Compiler.
The easy way to install TypeScript is through npm, the Node.js Package Manager.
If you have npm installed, you can install TypeScript globally (-g) on your computer by:
npm install -g typescript
- After installation run the below command check installation is successful or not.
tsc --version
Step 2: Creating the first TypeScript program in Visual Studio Code.
Please follow my instructions in video tutorial.
sample code :
let message: string = 'Hello World';
console.log(message);
Step 3: Set build output directory for generated .js file by creating 'tsconfig.json' file.
Add a simple tsconfig.json which set the options to compile to ES5 and use CommonJS modules.
use command : tsc.cmd --init
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"outDir": "out"
}
}
Step 4: Compiling and running .ts file.
open terminal and type : tsc.cmd filename (This will compile and create a new helloworld.js JavaScript file.)
now type : node filename.js
Step 5: Hit the like button and you can subscribe to support us and learn more.
If you found this video tutorial useful and would like to support me, you can do so by buying me a coffee using the below link!
https://buymeacoffee.com/CoolITHelp
#TypeScriptTutorialVSCode #TypeScript #CoolITHelp
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Running a TypeScript program in Visual Studio Code | VS Code Tutorial for Beginners», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.