Skip to main content

TypeScript

JavaScript with syntax for types

TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale.

What is TypeScript?

TypeScript is a programming language developed and maintained by Microsoft. It is a strict syntactical superset of JavaScript, adding optional static typing to the language. TypeScript is designed for development of large applications and compiles to JavaScript.

Type Safety

Catch errors early with static type checking before runtime

Modern JavaScript

Use the latest ECMAScript features with backward compatibility

IDE Support

Rich editor support with autocomplete and refactoring

Gradual Adoption

Add types incrementally to existing JavaScript projects

Key Features

TypeScript’s type system helps you find and fix bugs before your code runs. Types are completely optional, allowing you to adopt TypeScript gradually in existing JavaScript projects.
TypeScript includes powerful type features like generics, union types, intersection types, conditional types, and mapped types that enable precise type modeling.
Write using the latest JavaScript features (ES2015+) and TypeScript will compile your code to work on older JavaScript engines.
TypeScript’s language server provides intelligent code completion, parameter info, quick info, and member lists in your editor.
The TypeScript compiler supports incremental builds and project references for fast compilation in large codebases.
Use thousands of JavaScript libraries with TypeScript through type definitions. Write TypeScript that seamlessly integrates with JavaScript.

Why TypeScript?

TypeScript extends JavaScript by adding types to the language. Types provide a way to describe the shape of an object, providing better documentation and allowing TypeScript to validate that your code is working correctly. Writing types can be optional in TypeScript, because type inference allows you to get a lot of power without writing additional code. If types are available, the TypeScript type checker will help you catch bugs before they make it to production.
TypeScript adds syntax on top of JavaScript and doesn’t change how the code runs. This means any JavaScript code is valid TypeScript code.

Getting Started

Ready to start using TypeScript? Follow these steps:

Install TypeScript

Install the TypeScript compiler via npm

Quick Start

Create your first TypeScript file

CLI Commands

Learn the TypeScript compiler commands

Use Cases

TypeScript is used by developers and organizations of all sizes:
  • Frontend Applications: React, Angular, Vue.js applications with type safety
  • Backend Services: Node.js servers and APIs with TypeScript
  • Developer Tools: CLI tools, build systems, and developer utilities
  • Libraries and Frameworks: Published npm packages with type definitions
  • Large Codebases: Enterprise applications requiring maintainability
TypeScript is used by Microsoft, Google, Airbnb, Slack, and thousands of other companies worldwide.

Community and Support

Build docs developers (and LLMs) love