agentcooper / typescript-play

Better TypeScript playground

Home Page:https://typescript-play.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⚠️ Please use the offical TypeScript playground, now it has all the same features and even more. Use https://github.com/microsoft/TypeScript-Website/issues for issues and questions.


A better TypeScript playground.

Website: https://typescript-play.js.org.

Differences from https://www.typescriptlang.org/play:

  • All strict options turned on by default
  • More available compiler options
  • Ability to switch TypeScript version
  • More space for code
  • More examples
  • Quicker sharing, URL updates as you type
  • Shorter sharing URLs

Getting started

npm install
npm run setup
npm start

Updating TypeScript

Playground relies on UNPKG to fetch monaco-editor (contains typescript through monaco-typescript package).

In case if monaco-editor is not updated to the latest TypeScript, the latest version can be built with npm run get-typescript latest and served locally. If you run into errors, the latest monaco version may be incompatible with the latest typescript version, in which case you'll need to update monaco-typescript upstream, or apply a patch locally (see the # Patches section in get-typescript.sh.

In case you want to serve some specific version of TypeScript locally you should run npm run get-typescript <version>. For example, to serve TypeScript version 2.8.3 you should run npm run get-typescript 2.8.3; npm start

Browser compatibility

Tested with:

  • Chrome 65
  • Safari 11
  • Firefox 58
  • Microsoft Edge 41

Prior art

Other useful links

About

Better TypeScript playground

https://typescript-play.js.org


Languages

Language:JavaScript 35.1%Language:TypeScript 33.4%Language:HTML 22.7%Language:CSS 5.9%Language:Shell 3.0%