$ cnpm install ts-compiler
TypeScript compilation via the typescript-api.
This version is compatable with TypeScript 1.0.
/// <reference path="node_modules/ts-compiler/ts-compiler.d.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);
});
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(...)error and info events.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.
BooleanfalseGenerates corresponding .d.ts file.
StringSpecifies the location where debugger should locate map files instead of generated locations.
StringSpecify module code generation: commonjs or amd
BooleanfalseWarn on expressions and declarations with an implied any type.
BooleanfalseSkip resolution and preprocessing.
StringConcatenate and emit output to single file.
StringRedirect output structure to the directory.
BooleanfalseDo not emit comments to output.
BooleanfalseGenerates corresponding .map file.
StringSpecifies the location where debugger should locate TypeScript files instead of source locations.
StringES3Specify ECMAScript target version: 'ES3' or 'ES5'
StringInsert command line options and files from a file. This is natively supported by the tsc command, but as a different @file key.
BooleanfalseSkips writing the output files. This flag is unique to ts-compiler.
Released under the MIT license.
Copyright 2013 - present © cnpmjs.org | Home |