MCPcopy Index your code
hub / github.com/nodejs/node / shouldColorize

Function shouldColorize

lib/internal/util/colors.js:18–25  ·  view source on GitHub ↗
(stream)

Source from the content-addressed store, hash-verified

16 reset: '',
17 hasColors: false,
18 shouldColorize(stream) {
19 if (process.env.FORCE_COLOR !== undefined) {
20 return lazyInternalTTY().getColorDepth() > 2;
21 }
22 return stream?.isTTY && (
23 typeof stream.getColorDepth === 'function' ?
24 stream.getColorDepth() > 2 : true);
25 },
26 refresh() {
27 if (module.exports.shouldColorize(process.stderr)) {
28 module.exports.blue = '\u001b[34m';

Callers 2

constructorMethod · 0.85
shouldColorizeTestFilesFunction · 0.85

Calls 1

lazyInternalTTYFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…