roundel/supports-color
Every export of roundel/supports-color, with its signature and doc comment: createSupportsColor, supportsColor, plus 4 types.
import supportsColor from 'roundel/supports-color';
import { createSupportsColor } from 'roundel/supports-color';Functions
createSupportsColor
The colour support of stream, or of no stream in particular when it is left out.
function createSupportsColor(stream?: Pick<WriteStream, 'isTTY'>, options?: Options): ColorInfo;| Parameter | Type |
|---|---|
stream (optional) | Pick<WriteStream, 'isTTY'> |
options (optional) | Options |
Returns ColorInfo
Constants
default
The default export, declared as supportsColor.
supports-color's module: stdout's and stderr's support, decided at import.
const supportsColor: {
stdout: ColorInfo;
stderr: ColorInfo;
};Interfaces
ColorSupport
A level and what it implies.
interface ColorSupport {
level: ColorSupportLevel;
hasBasic: boolean;
has256: boolean;
has16m: boolean;
}Options
interface Options {
/** Whether `process.argv` is sniffed for `--color` and `--no-color` flags. Default `true`. */
readonly sniffFlags?: boolean;
/** The stream's TTY-ness, when it is not the stream's own `isTTY`. */
readonly streamIsTTY?: boolean | undefined;
}Types
ColorInfo
false when the stream gets no colour.
type ColorInfo = ColorSupport | false;ColorSupportLevel
0 no colour, 1 the basic 16, 2 ANSI 256, 3 truecolor.
type ColorSupportLevel = 0 | 1 | 2 | 3;roundel/picocolors
Every export of roundel/picocolors, with its signature and doc comment: createColors, isColorSupported, picocolors, plus 2 types.
roundel/yoctocolors
Every export of roundel/yoctocolors, with its signature and doc comment: reset, bold, dim, italic, underline, underlineDouble and 56 more, plus 1 type.