node package manager


String-in, string-out TypeScript compiler front-end


typestring is a simple JavaScript module providing a string-in, string-out TypeScript compiler front-end.

$ npm install typestring
var ts = require('typestring');
ts.compile('class Foo { public bar = 2; }');

Output string:

var Foo = (function () {
    function Foo() { = 2;
    return Foo;

File references can be used, but the file contents must be passed to compile as strings or buffers:

ts.compile('/// <reference path="foo.ts" />', {
  'foo.ts': fs.readFileSync('lib/foo.ts')

typestring is released under the terms of the MIT license. See LICENSE.