> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baenninger.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Compiler und Runtimes

Unser Browser versteht nur JavaScript. Deshalb müssen wir unseren TypeScript-Code in JavaScript-Code umwandeln. Das machen wir mit dem `tsc`-Compiler.

```bash theme={null}
npm install -g typescript
```

Nun können wir den `tsc`-Befehl nutzen. Um jetzt unseren TypeScript-Code in JavaScript-Code umzuwandeln, nutzen wir folgenden Befehl:

```bash theme={null}
tsc script.ts
```

Dieser Befehl erstellt uns dann ein neues `script.js`-File.

## Runtimes

Oftmals müssen wir unseren TypeScript-Code gar nicht manuell in ein JavaScript-File umwandeln, da die meisten modernen JavaScript-Runtimes wie Node, Bun und Deno TypeScript unterstützen und das automatisch für uns machen.

```bash theme={null}
bun script.ts
```
