This version has been deprecated

Author message:

typescript-node has been renamed to ts-node

typescript-node
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

TypeScript Node

NPM version NPM downloads Build status Test coverage

TypeScript execution environment for node.

Installation

npm install -g typescript-node

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

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

Issues

  • REPL currently does not work over each execution #1
  • Code coverage information does not work #2

License

MIT

Package Sidebar

Install

npm i typescript-node@0.0.3

Version

0.0.3

License

MIT

Last publish

Collaborators

  • blakeembrey