{"version":"0.1.2","author":{"name":"Diullei Gomes","email":"diullei@gmail.com"},"license":"MIT","name":"node-typescript","description":"The TypeScript API exposed to nodejs. Use to compile typescript code in memory","keywords":["TypeScript","Microsoft","compiler","language","javascript","nodejs"],"homepage":"","repository":{"type":"git","url":"git://github.com/Diullei/node-typescript"},"engines":{"node":"0.8.x"},"directories":{"lib":"./"},"main":"./ts-c.js","dependencies":{"typescript":"0.8.3"},"readme":"node-typescript\r\n===============\r\n\r\nThe TypeScript API exposed to nodejs. Use to compile typescript code in memory.\r\n\r\n## Usage\r\n\r\ninstall `node-typescript` with npm:\r\n\r\n\tnpm i node-typescript\r\n\r\nCreate a file with this sample code:\r\n\r\n```javascript\r\nvar tsc = require('./node_modules/node-typescript/lib/compiler');\r\nvar compiler = tsc.compiler;\r\n\r\ntsc.initDefault();\r\n\r\nvar code = '\\\r\nclass Greeter {\\\r\n    greeting: string;\\\r\n    constructor(message: string) {\\\r\n        this.greeting = message;\\\r\n    }\\\r\n    greet() {\\\r\n        return \"Hello, \" + this.greeting;\\\r\n    }\\\r\n}\\\r\nvar greeter = new Greeter(\"world\");\\\r\nvar button = document.createElement(\"button\");\\\r\nbutton.innerText = \"Say Hello\";\\\r\nbutton.onclick = function() {\\\r\n    alert(greeter.greet());\\\r\n};\\\r\ndocument.body.appendChild(button);\\\r\n';\r\n\r\ntsc.resolve(__dirname + '/xxx.ts', code, compiler);\r\n\r\ncompiler.typeCheck();\r\n\r\nvar stdout = new tsc.EmitterIOHost();\r\ncompiler.emit(stdout);\r\n```\r\n\r\nGet the javascript output in `stdout.fileCollection`. To this example the javascript output is:\r\n\r\n```javascript\r\n{ '.../xxx.js':\r\n   { lines:\r\n      [ 'var Greeter = (function () {',\r\n        '    function Greeter(message) {',\r\n        '        this.greeting = message;',\r\n        '    }',\r\n        '    Greeter.prototype.greet = function () {',\r\n        '        return \"Hello, \" + this.greeting;',\r\n        '    };',\r\n        '    return Greeter;',\r\n        '})();',\r\n        'var greeter = new Greeter(\"world\");',\r\n        'var button = document.createElement(\"button\");',\r\n        'button.innerText = \"Say Hello\";',\r\n        'button.onclick = function () {',\r\n        '    alert(greeter.greet());',\r\n        '};',\r\n        'document.body.appendChild(button);' ],\r\n     currentLine: '' } }\r\n```","readmeFilename":"README.md","_id":"node-typescript@0.1.2","dist":{"shasum":"b3807f78ada5e93d0fc815e81a2fc0fa0faec1c1","tarball":"http://registry-npm.ywwl.com/node-typescript/download/node-typescript-0.1.2.tgz","integrity":"sha512-KKRPt/kEqm+OU9UaOcIEjGocPNsX7n9R52XGwHtpB9NtDi5w0R+MImEjIGw8+SX5Hj5J7qb+3qYtOdLP36Kxfg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCH11kr4qdfybA/0WNjeK2T0P3T5cfZjgNOnZ3O6W/en8CIQCy6Sm02UAw0MRbX6WuspOOeeiMGzw1XcN4C+Qjj7s2ag=="}],"size":11470,"noattachment":false,"key":"/node-typescript/-/node-typescript-0.1.2.tgz"},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"diullei","email":"diullei@gmail.com"},"maintainers":[{"name":"diullei","email":"diullei@gmail.com"}],"publish_time":1363548928222,"_cnpm_publish_time":1363548928222,"dist-tags":{"latest":"0.1.3"}}