0.1.3 • Published 9 years ago

typescript-node v0.1.3

Weekly downloads
253
License
MIT
Repository
github
Last release
9 years ago

TypeScript Node

DEPRECATED: Use ts-node instead.

NPM version NPM downloads Build status Test coverage

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

Installation

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

# 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

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.

Configuration Options

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

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

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago