run typescript file

anurag31oct

Anurag Roy

Posted on May 2, 2022

run typescript file
  1. You must have npm, nodejs install in ur os.

  2. On cmd or other terminal run the command
    npm install -g typescript

  3. In any code editor write a typescript code and
    save it with ** .ts ** extension.

// ignore * in commands

  1. Now in terminal run these two commands one after another
    command1_

    ** tsc file_name.ts **
    

//tsc (typescript compiler will compile it and convert it
// into js file

then run the following command
command2_

    ** node file_name.js **
Enter fullscreen mode Exit fullscreen mode

:) you have successfully compiled and executed ur typescript file

💖 💪 🙅 🚩
anurag31oct
Anurag Roy

Posted on May 2, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related