\begin{quote}
Detect whether a terminal supports color \end{quote}
\hypertarget{md_sfcode_node_modules_istanbul_lib_report_node_modules_supports_color_readme_autotoc_md13549}{}\doxysection{Install}\label{md_sfcode_node_modules_istanbul_lib_report_node_modules_supports_color_readme_autotoc_md13549}

\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install supports-\/color }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_istanbul_lib_report_node_modules_supports_color_readme_autotoc_md13550}{}\doxysection{Usage}\label{md_sfcode_node_modules_istanbul_lib_report_node_modules_supports_color_readme_autotoc_md13550}

\begin{DoxyCode}{0}
\DoxyCodeLine{const supportsColor = require('supports-\/color');}
\DoxyCodeLine{}
\DoxyCodeLine{if (supportsColor.stdout) \{}
\DoxyCodeLine{    console.log('Terminal stdout supports color');}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{if (supportsColor.stdout.has256) \{}
\DoxyCodeLine{    console.log('Terminal stdout supports 256 colors');}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{if (supportsColor.stderr.has16m) \{}
\DoxyCodeLine{    console.log('Terminal stderr supports 16 million colors (truecolor)');}
\DoxyCodeLine{\} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_istanbul_lib_report_node_modules_supports_color_readme_autotoc_md13551}{}\doxysection{API}\label{md_sfcode_node_modules_istanbul_lib_report_node_modules_supports_color_readme_autotoc_md13551}
Returns an {\ttfamily Object} with a {\ttfamily stdout} and {\ttfamily stderr} property for testing either streams. Each property is an {\ttfamily Object}, or {\ttfamily false} if color is not supported.

The {\ttfamily stdout}/{\ttfamily stderr} objects specifies a level of support for color through a {\ttfamily .level} property and a corresponding flag\+:


\begin{DoxyItemize}
\item {\ttfamily .level = 1} and {\ttfamily .has\+Basic = true}\+: Basic color support (16 colors)
\item {\ttfamily .level = 2} and {\ttfamily .has256 = true}\+: 256 color support
\item {\ttfamily .level = 3} and {\ttfamily .has16m = true}\+: Truecolor support (16 million colors)
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_istanbul_lib_report_node_modules_supports_color_readme_autotoc_md13552}{}\doxysection{Info}\label{md_sfcode_node_modules_istanbul_lib_report_node_modules_supports_color_readme_autotoc_md13552}
It obeys the {\ttfamily -\/-\/color} and {\ttfamily -\/-\/no-\/color} CLI flags.

For situations where using {\ttfamily -\/-\/color} is not possible, use the environment variable {\ttfamily FORCE\+\_\+\+COLOR=1} (level 1), {\ttfamily FORCE\+\_\+\+COLOR=2} (level 2), or {\ttfamily FORCE\+\_\+\+COLOR=3} (level 3) to forcefully enable color, or {\ttfamily FORCE\+\_\+\+COLOR=0} to forcefully disable. The use of {\ttfamily FORCE\+\_\+\+COLOR} overrides all other color support checks.

Explicit 256/\+Truecolor mode can be enabled using the {\ttfamily -\/-\/color=256} and {\ttfamily -\/-\/color=16m} flags, respectively.\hypertarget{md_sfcode_node_modules_istanbul_lib_report_node_modules_supports_color_readme_autotoc_md13553}{}\doxysection{Related}\label{md_sfcode_node_modules_istanbul_lib_report_node_modules_supports_color_readme_autotoc_md13553}

\begin{DoxyItemize}
\item \href{https://github.com/chalk/supports-color-cli}{\texttt{ supports-\/color-\/cli}} -\/ CLI for this module
\item \href{https://github.com/chalk/chalk}{\texttt{ chalk}} -\/ Terminal string styling done right
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_istanbul_lib_report_node_modules_supports_color_readme_autotoc_md13554}{}\doxysection{Maintainers}\label{md_sfcode_node_modules_istanbul_lib_report_node_modules_supports_color_readme_autotoc_md13554}

\begin{DoxyItemize}
\item \href{https://github.com/sindresorhus}{\texttt{ Sindre Sorhus}}
\item \href{https://github.com/qix-}{\texttt{ Josh Junon}}
\end{DoxyItemize}

\DoxyHorRuler{0}


 {\bfseries{ \href{https://tidelift.com/subscription/pkg/npm-supports-color?utm_source=npm-supports-color&utm_medium=referral&utm_campaign=readme}{\texttt{ Get professional support for this package with a Tidelift subscription}} }} ~\newline
 \textsubscript{ Tidelift helps make open source sustainable for maintainers while giving companies~\newline
assurances about security, maintenance, and licensing for their dependencies. } 

\DoxyHorRuler{0}
 