How to use the supports-color.stderr.hasBasic function in supports-color

To help you get started, we’ve selected a few supports-color examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / supports-color / supports-color-tests.ts View on Github external
// Terminal standard output supports color
}

if (stdout.has256) {
    // Terminal standard output supports 256 colors
}

if (stdout.has16m) {
    // Terminal standard output supports 16 million colors (truecolor)
}

if (stderr) {
    // Terminal standard error supports color
}

if (stderr.hasBasic) {
    // Terminal standard error supports color
}

if (stderr.has256) {
    // Terminal standard error supports 256 colors
}

if (stderr.has16m) {
    // Terminal standard error supports 16 million colors (truecolor)
}