Skip to content

mbilal71/Typescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

Typescript

Learn Typescript from Scratch with Muhammad Bilal Siddique

Install# Installations and project starter kits

Installations:

  1. Install node js LTS (Long Term Supported version) which is v20.9.0 till (16-nov-2023).

  2. To confirm installation open your terminal/ command prompt.And run:

        `node -v`
    

    and

    `npm -v`
    

    "npm" is a package manager for Nodejs which is automatically installed with nodejs.
    v10.2.0 till (16-nov-2023)

  3. Run the following command to install typescript globally:

            `npm install -g typescript`
    

or

            `npm i -g typescript`

The second one is shorthand working of both are same.

v5.2.2 till (16-nov-2023)

  1. Install VS Code,an IDE (Integrated Development Environment) for writing typescript.

Node Project Starter Kit

  1. First of all create a new folder or open an empty folder (select name for folder without space) in the VS CODE.
  2. Then open a new terminal. To open terminal you will see a button terminal at the top of you VS Code screen click on it and the new terminal or press
ctrl + `

and run.(` key is present just under the esc key.) Note (For windows users): By default the terminal profile in the VS code is set to powershell. In window powershell has n't much permissions to run typescript compiler. So kindly shift to command prompt or cmd.

  1.            `npm init`
    

    or

     `npm init -y`
    

If you are running the first command it will ask you some questions for now ust press enter and go with default values. And the second command will do it automatically for you and after running the command you will get a package.json file.

  1. After running it, run:

        `tsc --init`
    

    A file name tsconfig.json will be created.

  2. Now create a file of any name (without space in the name) with an extention of .ts. For example, index.ts

  3. Code what ever you want or the assignment is given.

  4. Run

    `tsc`
    

in the same terminal to compile code. After running command you will get file with .js extention. Note: the file name will be same as you named it in .ts extention. 8. Now run

    `node fileName.js`

(replace fileName with your file name). For example, in my case it will be node index.js.

Best of Luck!

y case it will be node index.js.

Best of Luck!

About

Learn Typescript from Scratch with Muhammad Bilal Siddique

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors