Home

Awesome

ts-node-dev

Tweaked version of node-dev that uses ts-node under the hood.

It restarts target node process when any of required files changes (as standard node-dev) but shares Typescript compilation process between restarts. This significantly increases speed of restarting comparing to node-dev -r ts-node/register ..., nodemon -x ts-node ... variations because there is no need to instantiate ts-node compilation each time.

Install

npm (scoped) Build Status

yarn add ts-node-dev --dev
npm i ts-node-dev --save-dev

Usage

ts-node-dev [node-dev|ts-node flags] [ts-node-dev flags] [node cli flags] [--] [script] [script arguments]

So you just combine node-dev and ts-node options (see docs of those packages):

ts-node-dev --respawn --transpile-only server.ts

There is also short alias tsnd for running ts-node-dev:

tsnd --respawn server.ts

Look up flags and options can be used in ts-node's docs.

Also there are additional options specific to ts-node-dev:

If you need to detect that you are running with ts-node-dev, check if process.env.TS_NODE_DEV is set.

Points of notice:

Issues

If you have an issue, please create one. But, before:

Versioning

Currently versioning is not stable and it is still treated as pre-release. You might expect some options API changes. If you want to avoid unexpected problems it is recommended to fixate the installed version and update only in case of issues, you may consult CHANGELOG for updates.

License

MIT.