5.0.2 • Published 9 months ago

@ts-tools/node v5.0.2

Weekly downloads
4,104
License
MIT
Repository
github
Last release
9 months ago

@ts-tools/node

npm version

TypeScript support for Node.js.

This package installs a require extension, adding support for running .ts and .tsx files directly from source.

Features:

  • Fast! Uses ts.transpileModule. Leaves type checking to other flows.
  • Uses persistent disk caching (./node_modules/.cache/ts-<module>-<target>). Second run will not re-transpile a file if not changed.
  • Built-in support for source-maps, powered by source-map-support.
  • Node 8+ friendly default compiler options.

Getting started

Install the library as a dev dependency in an existing TypeScript project:

npm i @ts-tools/node --save-dev

Usage with Node.js:

node -r @ts-tools/node/r ./my-script.ts

Usage with Mocha:

mocha -r @ts-tools/node/r "./test/**/*.test.ts?(x)" --watch-extensions ts,tsx

OR, create a .mocharc.js file with:

module.exports = {
  require: ['@ts-tools/node/r'],
  extension: ['js', 'json', 'ts', 'tsx'],
};

Usage with Visual Studio Code:

// in .vscode/launch.json, under "configurations"
{
  "type": "node",
  "request": "launch",
  "name": "Launch Program",
  "runtimeArgs": ["-r", "@ts-tools/node/r"],
  "args": ["${workspaceFolder}/src/my-script.ts"]
}

Similar projects

ts-node - a much more complete solution. It includes a ts-node cli/repl, and require hook registration.

License

MIT

5.0.2

9 months ago

5.0.1

10 months ago

5.0.0

10 months ago

4.0.0

2 years ago

3.0.1

3 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.1.3

4 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.11.0

5 years ago

0.9.10

5 years ago

0.9.9

5 years ago

0.9.8

5 years ago

0.9.7

5 years ago

0.9.6

5 years ago

0.9.5

5 years ago

0.9.4

5 years ago

0.9.3

5 years ago

0.9.2

5 years ago

0.9.1

5 years ago

0.9.0

5 years ago

0.8.3

5 years ago

0.8.2

5 years ago

0.8.1

5 years ago

0.8.0

5 years ago

0.7.4

5 years ago

0.7.3

5 years ago

0.7.2

5 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.8

6 years ago

0.6.7

6 years ago

0.6.6

6 years ago

0.6.5

6 years ago

0.6.4

6 years ago

0.6.3

6 years ago

0.6.2

6 years ago

0.6.1

6 years ago