Skip to content

Interactive playground

This is a proof-of-concept in-browser TypeScript editor. It compiles TypeScript to JavaScript directly in your browser and prints the result.

Note

This page is a quick demo. It transpiles TypeScript and runs the emitted JavaScript. It does not perform full project-level type checking, and it cannot use Node.js or npm packages.

Editor

Write TypeScript in the box below and click Run TypeScript. If you arrived from another page, the starter code is already filled in.





Suggested things to try

  • Add an explicit type annotation that conflicts with a value, such as const count: number = 'hello', and see the transpile error.
  • Define an interface and a function that uses it.
  • Use map and filter on an array.
  • Try adding import or fetch calls — these will fail because the playground has no module loader or network.

How it works

  1. The page loads the typescript compiler from a CDN.
  2. When you click Run, transpileModule converts the TypeScript to JavaScript in the browser.
  3. The emitted JavaScript is evaluated, and console.log output is captured into the result panel.

Limitations

  • No full type checking. Complex type errors may not appear.
  • No npm packages or Node.js APIs.
  • No import/export support.
  • eval is used for the runner, so only run code you trust.