# typescript-node

> TypeScript execution environment for node

Latest version **0.1.3** (published 2015-09-18) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install typescript-node
pnpm add typescript-node
yarn add typescript-node
bun add typescript-node
```

Provides the command `ts-node`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2015-09-18 |
| First published | 2015-07-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 13120 |
| Author | Blake Embrey |
| Maintainers | blakeembrey |
| Keywords | typescript, node, runtime, environment, ts, compiler |

## Links

- npm: https://www.npmjs.com/package/typescript-node
- Repository: https://github.com/blakeembrey/typescript-node
- Issues: https://github.com/blakeembrey/typescript-node/issues
- npm.io page: https://npm.io/package/typescript-node

## Dependencies (8)

- [diff](https://npm.io/package/diff.md) ^2.1.1
- [chalk](https://npm.io/package/chalk.md) ^1.1.1
- [xtend](https://npm.io/package/xtend.md) ^4.0.0
- [arrify](https://npm.io/package/arrify.md) ^1.0.0
- [minimist](https://npm.io/package/minimist.md) ^1.2.0
- [tsconfig](https://npm.io/package/tsconfig.md) ^1.0.1
- [make-error](https://npm.io/package/make-error.md) ^1.0.2
- [source-map-support](https://npm.io/package/source-map-support.md) ^0.3.2

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 0.1.3 (latest) — 2015-09-18
- 0.1.2 — 2015-09-12
- 0.1.1 — 2015-09-12
- 0.1.0 — 2015-09-11
- 0.0.9 — 2015-09-09
- 0.0.8 — 2015-09-06
- 0.0.7 — 2015-07-23
- 0.0.6 — 2015-07-21
- 0.0.5 — 2015-07-15
- 0.0.4 — 2015-07-15
- 0.0.3 — 2015-07-15
- 0.0.2 — 2015-07-15
- 0.0.1 — 2015-07-15

## README

# TypeScript Node

**DEPRECATED: Use [ts-node](https://www.npmjs.com/package/ts-node) instead.**

[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]

> TypeScript execution environment for node. **Works with `typescript@>=1.5`**.

## Installation

```sh
npm install -g typescript-node

# Make sure you install your TypeScript-compatible compiler.
npm install -g typescript
```

## Features

* Execute TypeScript with node
* Interactive REPL
* Execute (and print) TypeScript inline
* Supports source maps
* Supports `tsconfig.json`

## Usage

```sh
# Execute a script as you world normally with `node`.
ts-node script.ts

# Start a TypeScript REPL
ts-node

# Execute code snippets with TypeScript
ts-node -e 'console.log("Hello, world!")'

# Execute and print code snippets with TypeScript
ts-node -p '"Hello, world!"'
```

**With Mocha**

```
mocha test.ts --require typescript-node/register src/**/*.spec.ts
```

**With Tape:**

```
ts-node tape src/**/*.spec.ts
```

### Using TypeScript With Node Programmatically

```js
require('typescript-node').register({ /* options */ })

// Or using the shortcut file.
require('typescript-node/register')
```

### Loading `tsconfig.json`

**Typescript Node** automatically loads `tsconfig.json` options and files from the current directory using [tsconfig](https://github.com/TypeStrong/tsconfig).

### Configuration Options

You can set options by passing them in before the script.

```sh
ts-node --compiler ntypescript --configFile tsconfig.json --ignoreWarnings 2304 hello-world.ts
```

* **compiler** Use a custom, require-able TypeScript compiler compatible with `typescript@>=1.5.0-alpha`
* **configFile** Manually set the location of the `tsconfig.json` file
* **ignoreWarnings** Set an array of TypeScript diagnostic codes to ignore

## License

MIT

[npm-image]: https://img.shields.io/npm/v/typescript-node.svg?style=flat
[npm-url]: https://npmjs.org/package/typescript-node
[downloads-image]: https://img.shields.io/npm/dm/typescript-node.svg?style=flat
[downloads-url]: https://npmjs.org/package/typescript-node
[travis-image]: https://img.shields.io/travis/blakeembrey/typescript-node.svg?style=flat
[travis-url]: https://travis-ci.org/blakeembrey/typescript-node
[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/typescript-node.svg?style=flat
[coveralls-url]: https://coveralls.io/r/blakeembrey/typescript-node?branch=master

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