Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    typestringpublic

    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.

    install

    npm i typestring

    Downloadsweekly downloads

    97

    version

    2.6.1

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar