# ts-runner

> Executes TypeScript, including references, in node by transpiling to JavaScript on the fly.

Latest version **0.3.1** (published 2016-04-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install ts-runner
pnpm add ts-runner
yarn add ts-runner
bun add ts-runner
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2016-04-19 |
| First published | 2016-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kevin Phelps |
| Maintainers | kevinphelps |

## Links

- npm: https://www.npmjs.com/package/ts-runner
- Repository: https://github.com/kevinphelps/ts-runner
- Homepage: https://github.com/kevinphelps/ts-runner#readme
- Issues: https://github.com/kevinphelps/ts-runner/issues
- npm.io page: https://npm.io/package/ts-runner

## Dependencies (1)

- [typescript](https://npm.io/package/typescript.md) 1.8.10

## Recent versions

- 0.3.1 (latest) — 2016-04-19
- 0.3.0 — 2016-04-19
- 0.2.0 — 2016-04-15
- 0.1.3 — 2016-04-15
- 0.1.2 — 2016-04-15
- 0.1.1 — 2016-04-15

## README

# ts-runner
[![Build Status](https://api.travis-ci.org/kevinphelps/ts-runner.svg?branch=master)](https://travis-ci.org/kevinphelps/ts-runner)
[![NPM Version](https://img.shields.io/npm/v/ts-runner.svg)](https://www.npmjs.com/package/ts-runner)
[![Dependency Status](https://david-dm.org/kevinphelps/ts-runner.svg)](https://david-dm.org/kevinphelps/ts-runner)
[![Dev Dependency Status](https://david-dm.org/kevinphelps/ts-runner/dev-status.svg)](https://david-dm.org/kevinphelps/ts-runner#info=devDependencies)

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 as `thisArg` when 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 to `tsc`, for example, '--noImplicitAny'. The default is an empty string.
-  `tempFilename` (string, optional): The path to a temporary file to pass to `tcs`. The default is './__temp.js'. This file is deleted immediately after compilitation completes.

## Usage

```javascript
'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 `tsc` full compile

### 0.1.1 - 0.1.3
- minor updates - linting, readme (no functional changes)

### 0.1.0
- initial implementation

---
_Source: https://npm.io/package/ts-runner · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
