\begin{quote}
Check if \href{https://nodejs.org/docs/latest/api/process.html\#process_process_argv}{\texttt{ {\ttfamily argv}}} has a specific flag \end{quote}
Correctly stops looking after an {\ttfamily -\/-\/} argument terminator.

\DoxyHorRuler{0}


 {\bfseries{ \href{https://tidelift.com/subscription/pkg/npm-has-flag?utm_source=npm-has-flag&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_istanbul_lib_report_node_modules_has_flag_readme_autotoc_md13495}{}\doxysection{Install}\label{md_sfcode_node_modules_istanbul_lib_report_node_modules_has_flag_readme_autotoc_md13495}

\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install has-\/flag }

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

\begin{DoxyCode}{0}
\DoxyCodeLine{// foo.js}
\DoxyCodeLine{const hasFlag = require('has-\/flag');}
\DoxyCodeLine{}
\DoxyCodeLine{hasFlag('unicorn');}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{}
\DoxyCodeLine{hasFlag('-\/-\/unicorn');}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{}
\DoxyCodeLine{hasFlag('f');}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{}
\DoxyCodeLine{hasFlag('-\/f');}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{}
\DoxyCodeLine{hasFlag('foo=bar');}
\DoxyCodeLine{//=> true}
\DoxyCodeLine{}
\DoxyCodeLine{hasFlag('foo');}
\DoxyCodeLine{//=> false}
\DoxyCodeLine{}
\DoxyCodeLine{hasFlag('rainbow');}
\DoxyCodeLine{//=> false }

\end{DoxyCode}



\begin{DoxyCode}{0}
\DoxyCodeLine{\$ node foo.js -\/f -\/-\/unicorn -\/-\/foo=bar -\/-\/ -\/-\/rainbow }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_istanbul_lib_report_node_modules_has_flag_readme_autotoc_md13497}{}\doxysection{API}\label{md_sfcode_node_modules_istanbul_lib_report_node_modules_has_flag_readme_autotoc_md13497}
\hypertarget{md_sfcode_node_modules_istanbul_lib_report_node_modules_has_flag_readme_autotoc_md13498}{}\doxysubsection{has\+Flag(flag, \mbox{[}argv\mbox{]})}\label{md_sfcode_node_modules_istanbul_lib_report_node_modules_has_flag_readme_autotoc_md13498}
Returns a boolean for whether the flag exists.\hypertarget{md_sfcode_node_modules_istanbul_lib_report_node_modules_has_flag_readme_autotoc_md13499}{}\doxysubsubsection{flag}\label{md_sfcode_node_modules_istanbul_lib_report_node_modules_has_flag_readme_autotoc_md13499}
Type\+: {\ttfamily string}

CLI flag to look for. The {\ttfamily -\/-\/} prefix is optional.\hypertarget{md_sfcode_node_modules_istanbul_lib_report_node_modules_has_flag_readme_autotoc_md13500}{}\doxysubsubsection{argv}\label{md_sfcode_node_modules_istanbul_lib_report_node_modules_has_flag_readme_autotoc_md13500}
Type\+: {\ttfamily string\mbox{[}\mbox{]}}~\newline
 Default\+: {\ttfamily process.\+argv}

CLI arguments.\hypertarget{md_sfcode_node_modules_istanbul_lib_report_node_modules_has_flag_readme_autotoc_md13501}{}\doxysection{Security}\label{md_sfcode_node_modules_istanbul_lib_report_node_modules_has_flag_readme_autotoc_md13501}
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_istanbul_lib_report_node_modules_has_flag_readme_autotoc_md13502}{}\doxysection{License}\label{md_sfcode_node_modules_istanbul_lib_report_node_modules_has_flag_readme_autotoc_md13502}
MIT © \href{https://sindresorhus.com}{\texttt{ Sindre Sorhus}} 