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?
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
--silentto 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.
Most helpful comment
Should work with
--quietflag.