\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_log_symbols_node_modules_has_flag_readme_autotoc_md16212}{}\doxysection{Install}\label{md_sfcode_node_modules_log_symbols_node_modules_has_flag_readme_autotoc_md16212}

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

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

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

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

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