0.3.1 • Published 10 years ago
ts-runner v0.3.1
ts-runner
Executes TypeScript, including references, in node by transpiling to JavaScript on the fly.
API
tsRunner.run(sourcePath, _this, _arguments, options, tempFilename):
Compiles TypesScript code and executes in the given node context (supplied by _this and _arguments). Any errors will be passed to console.error.
sourcePath(string, required): The path of the TypeScript file to compile. References will be followed._this(object, required): Object to use asthisArgwhen executing the compiled JavaScript._arguments(array, required): The node arguments (exports, require, module, filename, dirname) to use when executing the compiled JavaScript.options(string, optional): Options to pass totsc, for example, '--noImplicitAny'. The default is an empty string.tempFilename(string, optional): The path to a temporary file to pass totcs. The default is './__temp.js'. This file is deleted immediately after compilitation completes.
Usage
'use strict';
let tsRunner = require('ts-runner');
tsRunner.run('./implementation/index.ts', this, arguments, '--noImplicitAny');Versions
0.3.1
- attempt to find correct source path
0.3.0
- use current version of TypeScript compile
0.2.0
- update to use
tscfull compile
0.1.1 - 0.1.3
- minor updates - linting, readme (no functional changes)
0.1.0
- initial implementation