\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_jest_worker_node_modules_has_flag_readme_autotoc_md13953}{}\doxysection{Install}\label{md_sfcode_node_modules_jest_worker_node_modules_has_flag_readme_autotoc_md13953}

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

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

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

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

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