\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_inquirer_node_modules_has_flag_readme_autotoc_md12802}{}\doxysection{Install}\label{md_sfcode_node_modules_inquirer_node_modules_has_flag_readme_autotoc_md12802}

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

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

\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_inquirer_node_modules_has_flag_readme_autotoc_md12804}{}\doxysection{API}\label{md_sfcode_node_modules_inquirer_node_modules_has_flag_readme_autotoc_md12804}
\hypertarget{md_sfcode_node_modules_inquirer_node_modules_has_flag_readme_autotoc_md12805}{}\doxysubsection{has\+Flag(flag, \mbox{[}argv\mbox{]})}\label{md_sfcode_node_modules_inquirer_node_modules_has_flag_readme_autotoc_md12805}
Returns a boolean for whether the flag exists.\hypertarget{md_sfcode_node_modules_inquirer_node_modules_has_flag_readme_autotoc_md12806}{}\doxysubsubsection{flag}\label{md_sfcode_node_modules_inquirer_node_modules_has_flag_readme_autotoc_md12806}
Type\+: {\ttfamily string}

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

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