\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_ora_node_modules_has_flag_readme_autotoc_md19181}{}\doxysection{Install}\label{md_sfcode_node_modules_ora_node_modules_has_flag_readme_autotoc_md19181}

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

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

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

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

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