\begin{quote}
Detect whether a terminal supports color \end{quote}
\hypertarget{md_sfcode_node_modules_resolve_url_loader_node_modules_supports_color_readme_autotoc_md24809}{}\doxysection{$<$/blockquote$>$}\label{md_sfcode_node_modules_resolve_url_loader_node_modules_supports_color_readme_autotoc_md24809}
 {\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}
\hypertarget{md_sfcode_node_modules_resolve_url_loader_node_modules_supports_color_readme_autotoc_md24811}{}\doxysection{Install}\label{md_sfcode_node_modules_resolve_url_loader_node_modules_supports_color_readme_autotoc_md24811}

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

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

\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_resolve_url_loader_node_modules_supports_color_readme_autotoc_md24813}{}\doxysection{API}\label{md_sfcode_node_modules_resolve_url_loader_node_modules_supports_color_readme_autotoc_md24813}
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_resolve_url_loader_node_modules_supports_color_readme_autotoc_md24814}{}\doxysection{Info}\label{md_sfcode_node_modules_resolve_url_loader_node_modules_supports_color_readme_autotoc_md24814}
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_resolve_url_loader_node_modules_supports_color_readme_autotoc_md24815}{}\doxysection{Security}\label{md_sfcode_node_modules_resolve_url_loader_node_modules_supports_color_readme_autotoc_md24815}
To report a security vulnerability, please use the \href{https://tidelift.com/security}{\texttt{ Tidelift security contact}}. Tidelift will coordinate the fix and disclosure.\hypertarget{md_sfcode_node_modules_resolve_url_loader_node_modules_supports_color_readme_autotoc_md24816}{}\doxysection{Related}\label{md_sfcode_node_modules_resolve_url_loader_node_modules_supports_color_readme_autotoc_md24816}

\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_resolve_url_loader_node_modules_supports_color_readme_autotoc_md24817}{}\doxysection{Maintainers}\label{md_sfcode_node_modules_resolve_url_loader_node_modules_supports_color_readme_autotoc_md24817}

\begin{DoxyItemize}
\item \href{https://github.com/sindresorhus}{\texttt{ Sindre Sorhus}}
\item \href{https://github.com/qix-}{\texttt{ Josh Junon}}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_resolve_url_loader_node_modules_supports_color_readme_autotoc_md24818}{}\doxysection{License}\label{md_sfcode_node_modules_resolve_url_loader_node_modules_supports_color_readme_autotoc_md24818}
MIT 