Ts-node-dev: Silencing 'Ignore watch' & versions in outuput

Created on 28 Mar 2020  ยท  11Comments  ยท  Source: wclr/ts-node-dev

I'm using ts-node-dev in a project that contains a few CLI commands written in TypeScript. To run a command, I type yarn exe path/to/command.ts and this works because of a script in package.json:

"exe:dev": "ts-node-dev --ignore-watch=.next --ignore-watch=node_modules --ignore-watch=src/client --ignore-watch=src/components --ignore-watch=src/hooks --ignore-watch=src/pages --transpile-only --compiler-options '{\"module\":\"commonjs\", \"target\": \"es2017\"}'",

All is cool, there is only one little issue โ€“ I constantly see these redundant lines, which are somewhat distracting:

Ignore watch: [
  '.next',
  'node_modules',
  'src/client',
  'src/components',
  'src/hooks',
  'src/pages'
]
Using ts-node version 8.8.1, typescript version 3.8.3

It'd be great if ts-node-dev had a flag for silencing this. How about --silent, similar to what Yarn has? From yarn --help:

    -s, --silent      skip Yarn console logs, other types of logs
                      (script output) will be printed

I'm happy to submit a PR that adds -s / --silent if that can get through into a release ๐Ÿ™Œ

WDYT @whitecolor?

Most helpful comment

Should work with --quiet flag.

All 11 comments

Ignore watch should not be outputting now. Not sure if Using ts-node line is really redudant.

Thank you for your updates in ts-node-dev, @whitecolor! I can confirm that after upgrading to ^1.0.0-pre.47, the output has reduced to just this:

Using ts-node version 8.10.2, typescript version 3.9.5

Removal of Ignore watch solves the problem for me, which is great ๐Ÿš€ However, I can imagine that --silent to be still useful to others, so happy for you to decide if we keep this issue open or not ๐Ÿ™‚

Thanks again for your time! ๐Ÿ™Œ

Ok, will add probably --silent.

I can imagine that --silent to be still useful to others

I agree. It would be very nice not to see these versions information every time ts-node-dev restarts.

@plashenkov made it shown only on the first start in the latest.

@whitecolor Great! Thank you!

@whitecolor what do you mean by the 'first start'?

Wondering how this can affect tools that wrap ts-node-dev ๐Ÿค” IMHO, --silent (like in yarn) is still the best option because it produces consistent behaviour both useful to humans and tools.

@kachkaev
Just shows it when it is initialized, what problems can be with this?

I believe --silent should quite all the output, like restarting messages etc.

Just shows it when it is initialized

Not sure I fully understand what is meant here.

If I open a terminal and then

ts-node-dev ...args...
# ctrl+c
ts-node-dev ...args...

Will I see the version number the second time? This phrase suggests that it may not be the case:

made it shown only on the first start in the latest

I'm personally fine with seeing Using ts-node version 8.8.1, typescript version 3.8.3 on each start, but would be a bit confused if it only showed the first time but not the second.


Your point about silencing the rest of the output like the restart messages is valid. Perhaps, this suggests that --silent may be an overkill. In that case, would it be possible to have some other arg that controls the verbosity level or accepts a set of output categories one might want to see? ๐Ÿค” I'm sure there are tools doing this.

@kachkaev Sure it will report version number each time you start it manually.
But when ts-node-dev restarts itself it will not show anymore (previously it showed)

Should work with --quiet flag.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gipcompany picture gipcompany  ยท  8Comments

Derya picture Derya  ยท  6Comments

timsuchanek picture timsuchanek  ยท  6Comments

Chnapy picture Chnapy  ยท  6Comments

danielpza picture danielpza  ยท  5Comments