Proposal
You simply do require('typescript').register() and then all require calls e.g. var foo = require('./foo') would load foo.ts if foo.js/json/etc are not found.
This would mean we would compile in-memory and completely skip all type checking and do a fast emit. This would however greatly help increase .ts adaption IMHO.
Currently there is a userland maintained : https://github.com/TypeStrong/ts-node
Motivation
CoffeeScript supports this via require('coffee-script').register(); (synonym for require('coffee-script/register');) so that once you call this function it patches require to support .coffee files.
E.g.
- Atom does this for coffee : here and here
- Grunt does this here
The implementation for coffeescript can be found here : http://coffeescript.org/documentation/docs/register.html
Where in typescript
This can potentially be done in an external NPM package, but: