0Pricing
TypeScript Academy · Lesson

First Program & Build/Run (tsc + node / tsx)

Write a simple TS program, compile with tsc, and run with node or tsx.

Intro

Goal: Write a small program, compile with tsc, and run the result with node or tsx.

Hello World

A minimal program: define a typed function and log a message.

// hello.ts
function hello(name: string): string {
  return `Hello, ${name}!`;
}

console.log(hello("TypeScript"));

All lessons in this course

  1. What is TypeScript? Benefits & use cases
  2. Install Node & TypeScript (npm i -D typescript), tsc --init
  3. First Program & Build/Run (tsc + node / tsx)
← Back to TypeScript Academy