Test whether or not the given path exists by checking with the file system. Like \href{https://nodejs.org/api/fs.html\#fs_fs_exists_path_callback}{\texttt{ {\ttfamily fs.\+exists}}}, but with a normal callback signature (err, exists). Uses {\ttfamily fs.\+access} under the hood.


\begin{DoxyItemize}
\item {\ttfamily file} {\ttfamily $<$String$>$}
\item {\ttfamily callback} {\ttfamily $<$Function$>$}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_fs_extra_docs_pathExists_autotoc_md11031}{}\doxysection{Example\+:}\label{md_sfcode_node_modules_fs_extra_docs_pathExists_autotoc_md11031}

\begin{DoxyCode}{0}
\DoxyCodeLine{const fs = require('fs-\/extra')}
\DoxyCodeLine{}
\DoxyCodeLine{const file = '/tmp/this/path/does/not/exist/file.txt'}
\DoxyCodeLine{// Promise usage:}
\DoxyCodeLine{fs.pathExists(file)}
\DoxyCodeLine{  .then(exists => console.log(exists)) // => false}
\DoxyCodeLine{// Callback usage:}
\DoxyCodeLine{fs.pathExists(file, (err, exists) => \{}
\DoxyCodeLine{  console.log(err) // => null}
\DoxyCodeLine{  console.log(exists) // => false}
\DoxyCodeLine{\}) }

\end{DoxyCode}
 