DEV Community

Anurag Roy
Anurag Roy

Posted on

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

Top comments (0)