If we write a Typescript program then how should we run it on Windows?
We already know how to run Javascript (.js) from a command line on Windows:
C:\Users\Harikesh>cscript MyScriptFile.js
What is the equivalent for TypeScript (.ts) files?
You can compile the Typescript down to Javascript, and then run it from a command line with Node.js, or in a web browser:
1) Download and install Node.js.
2) Open a Windows command prompt and run:
npm install -g typescript
3) Navigate to the directory where your typescript file is in, and type:
tsc yourtypescriptfile.ts
4a) Run the resulting JavaScript file with Node.js:
node yourtypescriptfile.js
-or-
4b) Make an HTML file (in the same directory) that includes yourtypescriptfile.js using <source></source> tags:
<script src="yourtypescriptfile.js"></script>
5) Open your HTML file in a web browser.
Help from: http://javascript.info/tutorial/adding-script-html
If we write a typescript program then how should we run it on window platform?
Using NodeJS : https://nodejs.org/en/
Same as JavaScript to be exact.
.ts file to .js file and then run it as nodejs script.>cscript example.js. No Node needed.
NodeJSand TypeScript Module..tsscript that you've written. Is there a specific part of that you're having issues with?>cscript example.js