supports-color
- Version 9.4.0
- Published
- 10.8 kB
- No dependencies
- MIT license
Install
npm i supports-color
yarn add supports-color
pnpm add supports-color
Overview
Detect whether a terminal supports color
Index
Variables
Functions
Interfaces
Type Aliases
Variables
variable supportsColor
const supportsColor: { stdout: ColorInfo; stderr: ColorInfo };
Functions
function createSupportsColor
createSupportsColor: (stream?: WriteStream, options?: Options) => ColorInfo;
Interfaces
interface ColorSupport
interface ColorSupport {}
Detect whether the terminal supports color.
interface Options
interface Options {}
property sniffFlags
readonly sniffFlags?: boolean;
Whether
process.argv
should be sniffed for--color
and--no-color
flags.true
Type Aliases
type ColorInfo
type ColorInfo = ColorSupport | false;
type ColorSupportLevel
type ColorSupportLevel = 0 | 1 | 2 | 3;
Levels: -
0
- All colors disabled. -1
- Basic 16 colors support. -2
- ANSI 256 colors support. -3
- Truecolor 16 million colors support.
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (5)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/supports-color
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/supports-color)
- HTML<a href="https://www.jsdocs.io/package/supports-color"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 1964 ms. - Missing or incorrect documentation? Open an issue for this package.