/home_media

Simple project for learning Typescript

Primary LanguageTypeScriptApache License 2.0Apache-2.0

learn_Typescript

Simple project for learning Typescript

First install TypeScript

TypeScript is advance of JavaScript so mush intall npm first and init new project:

" install JavaScript "
sudo apt install npm
" Then init new project "
npm init -y

Globally Installing TypeScript for install on your computer

sudo npm install -g typescript

Run Typescript file

To run Typescript file must compile .ts files to .js

tsc index

' to run file '
node index.js

To watch live change on .js file run command:

tsc -w index.ts

And watch live result

' install nodemon'
npm i --save-dev nodemon
' run watch'
npm run watch

To init Typescipt project, typing

npx tsc --init