TypeScript: Introduction

Writing your first “Hello World” program in TypeScript with ease

In this lesson, we are going to learn about the basic structure of a TypeScript program and understand a few concepts of the compilation process. Then we will see how we can run the compiled JavaScript program using node and ts-node.

Uday Hiwarale
JsPoint
Published in
10 min readMay 15, 2020

--

(source: pexels.com)

In the previous lesson, we learn about the history of JavaScript and how TypeScript solves some of the problems linked with the JavaScript development in general. We also understood the process of compiling a TypeScript program to JavaScript using the built-in TypeScript compiler so that we can run it inside a browser or Node.

When you install TypeScript, you get the tsc command that invokes the TypeScript compiler. The TypeScript compiler is designed to process TypeScript program files (ending with .ts extension) and converting them to vanilla JavaScript files (ending with .js extension).

The tsc command takes the file paths of these TypeScript programs as command-line arguments as well as compiler-options to customize the compilation settings using command-line flags. The command-line API of TypeScript has been explained in detail in…

--

--