Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/michaelsboost/typescript-compile

Automatically compile TypeScript to JavaScript on the fly
https://github.com/michaelsboost/typescript-compile

compile compiler javascript typescript

Last synced: 19 days ago
JSON representation

Automatically compile TypeScript to JavaScript on the fly

Awesome Lists containing this project

README

        

TypeScript Compile
==================

[TypeScript](http://www.typescriptlang.org) is a brand new language which compiles on JavaScript. However, this operation has to be performed manually, using the command-line compiler `tsc` or other tools. But now it has drastically improved, thanks to TypeScript Compile! TypeScript Compile automatically transforms your TypeScript code into JavaScript on the fly! Just write your TS code between:


...

or include your TS file:

and add these two JS files **at the end of the HTML body**:


That's it! TypeScript will be compiled to JavaScript and immediately run, by appending the compiled script to the HTML body. You can see any compilation errors in the web console.

How It Works!
----

TypeScript Compile works by grabbing the typescript source from within the text/typescript tags (or via fetching the file(s)) and compiling it via TypeScript and then appending a new script of the compiled Javascript. By doing it this way Typescript Compile contains only 40 lines of Javascript and is only 4KB in size.

Inspired by the original [TypeScript Compile](https://github.com/niutech/typescript-compile) by Jerzy Głowacki.

Demo
----

[Here is a live demo](http://michaelsboost.github.io/typescript-compile/demo/demo.html)

Download
--------

[TypeScript 5.5](https://raw.github.com/michaelsboost/typescript-compile/main/js/typescript.min.js) (minified JS)
[TypeScript Compile 1.0.0](https://raw.github.com/michaelsboost/typescript-compile/main/js/typescript.compile.min.js) (minified JS)

License
-------------

MIT