tty: expose `hasColor` and `getColorDepth` directly
TODOs:-
-
Expose hasColor
-
Expose getColorDepth
-
Document new methods - [x] DeprecateWriteStream.hasColor
andWriteStream.getColorDepth
- [x] Add tests for same- [ ] Replace every instance ofWriteStream.hasColor
andWriteStream.getColorPath
with new methods intty
- [ ] Document new deprecated methods oftty
and add documentation for new methods
About deprecating tty.WriteStream.hasColor
and tty.WriteStream.getColorDepth
, this requires a lot of changes to be done which is not so backward compactible.
process.stdout
and process.stderr
have hasColor()
and getColorDepth()
methods which are forwarded from tty.WriteStream
, this means that deprecating tty.WriteStream.hasColor()
will also mean deprecation of process.stdout.hasColor
, similar for process.stdout
and getColorDepth)
So I am dropping the idea of deprecating these two methods for now. I would really appreciate some feedback from the team regarding this.
Fixes #40236 (closed)