{"name":"typescript-compiler","version":"0.9.7-3","description":"Typescript compiler wrapper","main":"main.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/theblacksmith/typescript-compiler.git"},"keywords":["TypeScript","compiler","language","javascript"],"author":{"name":"The Blacksmith","url":"a.k.a. Saulo Vallory"},"license":"MIT","bugs":{"url":"https://github.com/theblacksmith/typescript-compiler/issues"},"homepage":"https://github.com/theblacksmith/typescript-compiler","dependencies":{"typescript":">=0.9.7","underscore":"~1"},"_id":"typescript-compiler@0.9.7-3","dist":{"shasum":"3e0c3dc22fcd85c877c87cc46a5f03e476a67791","tarball":"http://registry-npm.ywwl.com/typescript-compiler/download/typescript-compiler-0.9.7-3.tgz","integrity":"sha512-SVZi5ZoM9zzJWVs5loogog7UtVBdkZ1KSoNpdk45Z1tggaHJaeN6hF9uszVp1NpJnyx6iQ2zx+EQGDBAY9A26Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHYH41as1cAPFZ7EEEoBN1vYMCm//ElGB0lBxuw/qdogIhANRmdtHY1lnoCkDw1gLVqImE90CEtS2+/ynsbWXoxwxe"}],"size":322151,"noattachment":false,"key":"/typescript-compiler/-/typescript-compiler-0.9.7-3.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"theblacksmith","email":"me@saulovallory.com"},"maintainers":[{"name":"theblacksmith","email":"me@saulovallory.com"}],"directories":{},"readme":"typescript-compiler\n===================\n\nTypescript compiler wrapper. Exposes the TypeScript command line compiler to your code.\n\n[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=theblacksmith&url=https%3A%2F%2Fgithub.com%2Ftheblacksmith%2Ftypescript-compiler)\n\nInstalling\n-----------------------\n\n    $ npm install typescript-compiler\n\nUsage\n-----------------------\n\nRequire the compiler...\n\n```javascript\nvar tsc = require('typescript-compiler');\n```\n\ncall it like this...\n\n```javascript\ntsc.compile(['a.ts', 'b.ts'], ['--out', 'out.js'])\n```\n\nor this..\n\n```javascript\nvar js = tsc.compileString('class TSC { awesome: boolean = true; }')\n```\n\nor even this!\n\n```javascript\nvar result = tsc.compileStrings({\n\t\t\t\t'ship.ts' : 'module Navy { export class Ship { isSunk: boolean; } }',\n\t\t\t\t'fleet.ts': '///<reference path=\"ship.ts\" />\\n' +\n\t\t\t\t\t\t\t'module Navy { \\n' +\n\t\t\t\t\t\t\t'export class Fleet { ships: Ship[] } '+\n\t\t\t\t\t\t\t'}'\n\t\t\t})\n```\n\n_Did you notice you can use **///&lt;reference />** tags?_\n\n## Module Interface\n\n**Note:** A `?` indicates an optional parameter\n\n### Common Parameters\n\nAll Methods accept the following parameters:\n\n> **tscArgs?** : `string[]`|`string`, <br>\n> &nbsp; &nbsp; &nbsp; &nbsp; The same [arguments you can pass to tsc](#tsc-arguments) when you run it from the command line <br>\n> **options?** : [`CompilerOptions`], <br>\n> &nbsp; &nbsp; &nbsp; &nbsp; Options to be passed to the compiler<br>\n> **onError?** : _fn_ ( [`Diagnostic`] )<br>\n> &nbsp; &nbsp; &nbsp; &nbsp; A function you want called for each error the compiler encounters.\n\n### Compilation Methods\n\n#### `compile(files, tscArgs?, options?, onError?)`\n\n> **input** : `string`|`string[]`<br>\n> &nbsp; &nbsp; &nbsp; &nbsp; The name of the file or an array of file names to compile.<br>\n> **returns** [`CompilationResult`]\n\n&nbsp; &nbsp; &nbsp; &nbsp; _Compiles one or many files_\n\n##### &nbsp; &nbsp; &nbsp; &nbsp; Example\n\n> ```javascript\n>     tsc.compile(['test/cases/ship.ts', 'test/cases/fleet.ts'],\n>     \t\t\t\t'-m commonjs -t ES5 --out test/tmp/navy.js');\n> ```\n\n#### `compileString(input, tscArgs?, options?, onError?)`\n\n> **input** : [`Map<string>`]|[`StringSource[]`][`StringSource`]|`string[]` <br>\n> &nbsp; &nbsp; &nbsp; &nbsp; The source to compile or an array of sources. The source(s) can be passed as strings or [`StringSource`] objects. <br>\n> **returns** `string`\n\n&nbsp; &nbsp; &nbsp; &nbsp; _Compiles a string_\n\n##### &nbsp; &nbsp; &nbsp; &nbsp; Example\n\n> ```javascript\n> tsc.compileString('module Navy { class Ship { isSunk: boolean; } }')\n> ```\n\n#### `compileStrings(input, tscArgs?, options?, onError?)`\n\n> **input** : [`Map<string>`]|[`StringSource`]|`string[]` <br>\n> &nbsp; &nbsp; A collection of sources to be compiled.<br>\n> **returns** [`CompilationResult`]\n\n&nbsp; &nbsp; &nbsp; &nbsp; Compiles one or many strings\n\n##### &nbsp; &nbsp; &nbsp; &nbsp; Example\n\n> ```javascript\n> tsc.compileStrings({\n>     \"ship.ts\"  : 'module Navy { export class Ship { isSunk: boolean; }}',\n>     \"fleet.ts\": '///<reference path=\"ship.ts\" />\\n' +\n>                 'module Navy { export class Fleet { ships: Ship[] }}'\n>    },\n>    // tscArgs\n>    '--module commonjs -t ES5 --out navy.js',\n>    // options (DEPRECATED, will be removed in the next version)\n>    null,\n>    // onError\n>    function(e) { console.log(e) }\n> )\n> ```\n\n\n#### TSC arguments\n\nWhen in doubt about what you can pass in the `tscArgs` param you can run the compiler from the command line to get some help. Every option you see below is accepted as a value for the `tscArgs` array.\n\n```\n$ tsc\nVersion 1.1.0.1\nSyntax:   tsc [options] [file ...]\n\nExamples: tsc hello.ts\n          tsc --out foo.js foo.ts\n          tsc @args.txt\n\nOptions:\n -d, --declaration  Generates corresponding '.d.ts' file.\n -h, --help         Print this message.\n --mapRoot          Specifies the location where debugger should locate map files instead of generated locations.\n -m, --module       Specify module code generation: 'commonjs' or 'amd'\n --noImplicitAny    Warn on expressions and declarations with an implied 'any' type.\n --out              Concatenate and emit output to single file.\n --outDir           Redirect output structure to the directory.\n --removeComments   Do not emit comments to output.\n --sourceMap        Generates corresponding '.map' file.\n --sourceRoot       Specifies the location where debugger should locate TypeScript files instead of source locations.\n -t, --target       Specify ECMAScript target version: 'ES3' (default), or 'ES5'\n -v, --version      Print the compiler's version.\n -w, --watch        Watch input files.\n @<file>            Insert command line options and files from a file.\n```\n\n[`CompilerOptions`]: https://github.com/theblacksmith/typescript-compiler/wiki/Interfaces#compileroptions\n[`Diagnostic`]: https://github.com/theblacksmith/typescript-compiler/wiki/Interfaces#diagnostic\n[`CompilationResult`]: https://github.com/theblacksmith/typescript-compiler/wiki/Interfaces#compilationresult\n[`StringSource`]: https://github.com/theblacksmith/typescript-compiler/wiki/Interfaces#stringsource-class\n[`Map<string>`]: https://github.com/theblacksmith/typescript-compiler/wiki/Interfaces#map\n","publish_time":1395368086179,"_cnpm_publish_time":1395368086179,"dist-tags":{"latest":"1.4.1-2"}}