gavinhungry / typestring

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

Home Page:https://npmjs.org/package/typestring

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

typestring

typestring is a string-in/string-out TypeScript compiler front-end.

Installation

$ npm install typestring

Example

let typestring = require('typestring');
let js = typestring.compile('class Foo { public bar = 2; }');

Output string:

var Foo = (function () {
    function Foo() {
        this.bar = 2;
    }
    return Foo;
})();

File references

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

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

License

This software is released under the terms of the MIT license. See LICENSE.

About

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

https://npmjs.org/package/typestring

License:MIT License


Languages

Language:JavaScript 100.0%