Minimal module to check if a file is executable, and a normal file.

Uses {\ttfamily fs.\+stat} and tests against the {\ttfamily PATHEXT} environment variable on Windows.\hypertarget{md_sfcode_node_modules_isexe_README_autotoc_md13275}{}\doxysection{USAGE}\label{md_sfcode_node_modules_isexe_README_autotoc_md13275}

\begin{DoxyCode}{0}
\DoxyCodeLine{var isexe = require('isexe')}
\DoxyCodeLine{isexe('some-\/file-\/name', function (err, isExe) \{}
\DoxyCodeLine{  if (err) \{}
\DoxyCodeLine{    console.error('probably file does not exist or something', err)}
\DoxyCodeLine{  \} else if (isExe) \{}
\DoxyCodeLine{    console.error('this thing can be run')}
\DoxyCodeLine{  \} else \{}
\DoxyCodeLine{    console.error('cannot be run')}
\DoxyCodeLine{  \}}
\DoxyCodeLine{\})}
\DoxyCodeLine{}
\DoxyCodeLine{// same thing but synchronous, throws errors}
\DoxyCodeLine{var isExe = isexe.sync('some-\/file-\/name')}
\DoxyCodeLine{}
\DoxyCodeLine{// treat errors as just "{}not executable"{}}
\DoxyCodeLine{isexe('maybe-\/missing-\/file', \{ ignoreErrors: true \}, callback)}
\DoxyCodeLine{var isExe = isexe.sync('maybe-\/missing-\/file', \{ ignoreErrors: true \}) }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_isexe_README_autotoc_md13276}{}\doxysection{API}\label{md_sfcode_node_modules_isexe_README_autotoc_md13276}
\hypertarget{md_sfcode_node_modules_isexe_README_autotoc_md13277}{}\doxysubsection{$<$tt$>$isexe(path, \mbox{[}options\mbox{]}, \mbox{[}callback\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_isexe_README_autotoc_md13277}
Check if the path is executable. If no callback provided, and a global {\ttfamily Promise} object is available, then a Promise will be returned.

Will raise whatever errors may be raised by {\ttfamily fs.\+stat}, unless {\ttfamily options.\+ignore\+Errors} is set to true.\hypertarget{md_sfcode_node_modules_isexe_README_autotoc_md13278}{}\doxysubsection{$<$tt$>$isexe.\+sync(path, \mbox{[}options\mbox{]})$<$/tt$>$}\label{md_sfcode_node_modules_isexe_README_autotoc_md13278}
Same as {\ttfamily isexe} but returns the value and throws any errors raised.\hypertarget{md_sfcode_node_modules_isexe_README_autotoc_md13279}{}\doxysubsection{Options}\label{md_sfcode_node_modules_isexe_README_autotoc_md13279}

\begin{DoxyItemize}
\item {\ttfamily ignore\+Errors} Treat all errors as \char`\"{}no, this is not executable\char`\"{}, but don\textquotesingle{}t raise them.
\item {\ttfamily uid} Number to use as the user id
\item {\ttfamily gid} Number to use as the group id
\item {\ttfamily path\+Ext} List of path extensions to use instead of {\ttfamily PATHEXT} environment variable on Windows. 
\end{DoxyItemize}