Install TypeScript

What

Setting up TypeScript locally involves installing the TypeScript compiler (tsc), which is the tool responsible for transforming your .ts files into valid .js files that can run in a browser or on a server.

How

You can install TypeScript globally using npm (Node Package Manager) and then verify the installation:

# Install globally
npm install -g typescript

# Check the version
tsc -v

Why

While browser-based playgrounds are great for learning, a local installation is necessary for real-world development. It allows you to integrate TypeScript into your build pipelines, use command-line flags for specific compilation needs, and ensure that your local development environment matches your production environment.

Summary

Installing tsc is the first step toward moving from a playground to a professional local development workflow.