TypeScript compilation via the typescript-api.
This version is compatable with TypeScript 0.9.5.
```ts
///
import ts = require('ts-compiler');
ts.compile(
['foo.ts', 'bar.ts'],
{ skipWrite: true },
(err: Error, results: ts.OutputFile[]) => {
var foo = results[0];
console.log(foo.text);
var bar = results[1];
console.log(bar.text);
});
```
```js
var ts = require('ts-compiler');
ts.compile(
['foo.ts', 'bar.ts'],
{ skipWrite: true },
function(err, results) {
var foo = results[0];
console.log(foo.text);
var bar = results[1];
console.log(bar.text);
});
```
new ts.BatchCompiler.compile(...)
Though all natively supported TypeScript compiler options will be passed through to the real compiler, it might not always make sense from an API standpoint. Use with common sense.
Boolean
false
Generates corresponding .d.ts file.
String
Specifies the location where debugger should locate map files instead of generated locations.
String
Specify module code generation: commonjs
or amd
Boolean
false
Warn on expressions and declarations with an implied any
type.
Boolean
false
Skip resolution and preprocessing.
String
Concatenate and emit output to single file.
String
Redirect output structure to the directory.
Boolean
false
Do not emit comments to output.
Boolean
false
Generates corresponding .map file.
String
Specifies the location where debugger should locate TypeScript files instead of source locations.
String
ES3
Specify ECMAScript target version: 'ES3' or 'ES5'
String
Insert command line options and files from a file. This is natively supported by the tsc command, but as a different @file key.
Boolean
false
Skips writing the output files. This flag is unique to ts-compiler.
Released under the MIT license.