\begin{quote}
Get the status of a file with some features. \end{quote}
\hypertarget{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2055}{}\doxysection{\+:bulb\+: Highlights}\label{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2055}
Wrapper around standard method {\ttfamily fs.\+lstat} and {\ttfamily fs.\+stat} with some features.


\begin{DoxyItemize}
\item \+:beginner\+: Normally follows symbolic link.
\item \+:gear\+: Can safely work with broken symbolic link.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2056}{}\doxysection{Install}\label{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2056}

\begin{DoxyCode}{0}
\DoxyCodeLine{npm install @nodelib/fs.stat }

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

\begin{DoxyCode}{0}
\DoxyCodeLine{import * as fsStat from '@nodelib/fs.stat';}
\DoxyCodeLine{}
\DoxyCodeLine{fsStat.stat('path', (error, stats) => \{ /* … */ \}); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2058}{}\doxysection{API}\label{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2058}
\hypertarget{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2059}{}\doxysubsection{.\+stat(path, \mbox{[}options\+Or\+Settings\mbox{]}, callback)}\label{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2059}
Returns an instance of {\ttfamily fs.\+Stats} class for provided path with standard callback-\/style.


\begin{DoxyCode}{0}
\DoxyCodeLine{fsStat.stat('path', (error, stats) => \{ /* … */ \});}
\DoxyCodeLine{fsStat.stat('path', \{\}, (error, stats) => \{ /* … */ \});}
\DoxyCodeLine{fsStat.stat('path', new fsStat.Settings(), (error, stats) => \{ /* … */ \}); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2060}{}\doxysubsection{.\+stat\+Sync(path, \mbox{[}options\+Or\+Settings\mbox{]})}\label{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2060}
Returns an instance of {\ttfamily fs.\+Stats} class for provided path.


\begin{DoxyCode}{0}
\DoxyCodeLine{const stats = fsStat.stat('path');}
\DoxyCodeLine{const stats = fsStat.stat('path', \{\});}
\DoxyCodeLine{const stats = fsStat.stat('path', new fsStat.Settings()); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2061}{}\doxysubsubsection{path}\label{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2061}

\begin{DoxyItemize}
\item Required\+: {\ttfamily true}
\item Type\+: {\ttfamily string $\vert$ Buffer $\vert$ URL}
\end{DoxyItemize}

A path to a file. If a URL is provided, it must use the {\ttfamily file\+:} protocol.\hypertarget{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2062}{}\doxysubsubsection{options\+Or\+Settings}\label{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2062}

\begin{DoxyItemize}
\item Required\+: {\ttfamily false}
\item Type\+: {\ttfamily Options $\vert$ Settings}
\item Default\+: An instance of {\ttfamily Settings} class
\end{DoxyItemize}

An \href{\#options}{\texttt{ {\ttfamily Options}}} object or an instance of \href{\#settings}{\texttt{ {\ttfamily Settings}}} class.

\begin{quote}
\+:book\+: When you pass a plain object, an instance of the {\ttfamily Settings} class will be created automatically. If you plan to call the method frequently, use a pre-\/created instance of the {\ttfamily Settings} class. \end{quote}
\hypertarget{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2063}{}\doxysubsection{Settings(\mbox{[}options\mbox{]})}\label{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2063}
A class of full settings of the package.


\begin{DoxyCode}{0}
\DoxyCodeLine{const settings = new fsStat.Settings(\{ followSymbolicLink: false \});}
\DoxyCodeLine{}
\DoxyCodeLine{const stats = fsStat.stat('path', settings); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2064}{}\doxysection{Options}\label{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2064}
\hypertarget{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2065}{}\doxysubsection{$<$tt$>$follow\+Symbolic\+Link$<$/tt$>$}\label{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2065}

\begin{DoxyItemize}
\item Type\+: {\ttfamily boolean}
\item Default\+: {\ttfamily true}
\end{DoxyItemize}

Follow symbolic link or not. Call {\ttfamily fs.\+stat} on symbolic link if {\ttfamily true}.\hypertarget{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2066}{}\doxysubsection{$<$tt$>$mark\+Symbolic\+Link$<$/tt$>$}\label{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2066}

\begin{DoxyItemize}
\item Type\+: {\ttfamily boolean}
\item Default\+: {\ttfamily false}
\end{DoxyItemize}

Mark symbolic link by setting the return value of {\ttfamily is\+Symbolic\+Link} function to always {\ttfamily true} (even after {\ttfamily fs.\+stat}).

\begin{quote}
\+:book\+: Can be used if you want to know what is hidden behind a symbolic link, but still continue to know that it is a symbolic link. \end{quote}
\hypertarget{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2067}{}\doxysubsection{$<$tt$>$throw\+Error\+On\+Broken\+Symbolic\+Link$<$/tt$>$}\label{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2067}

\begin{DoxyItemize}
\item Type\+: {\ttfamily boolean}
\item Default\+: {\ttfamily true}
\end{DoxyItemize}

Throw an error when symbolic link is broken if {\ttfamily true} or safely return {\ttfamily lstat} call if {\ttfamily false}.\hypertarget{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2068}{}\doxysubsection{$<$tt$>$fs$<$/tt$>$}\label{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2068}

\begin{DoxyItemize}
\item Type\+: \href{./src/adapters/fs.ts}{\texttt{ {\ttfamily File\+System\+Adapter}}}
\item Default\+: A default FS methods
\end{DoxyItemize}

By default, the built-\/in Node.\+js module ({\ttfamily fs}) is used to work with the file system. You can replace any method with your own.


\begin{DoxyCode}{0}
\DoxyCodeLine{interface FileSystemAdapter \{}
\DoxyCodeLine{    lstat?: typeof fs.lstat;}
\DoxyCodeLine{    stat?: typeof fs.stat;}
\DoxyCodeLine{    lstatSync?: typeof fs.lstatSync;}
\DoxyCodeLine{    statSync?: typeof fs.statSync;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{const settings = new fsStat.Settings(\{}
\DoxyCodeLine{    fs: \{ lstat: fakeLstat \}}
\DoxyCodeLine{\}); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2069}{}\doxysection{Changelog}\label{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2069}
See the \href{https://github.com/nodelib/nodelib/releases}{\texttt{ Releases section of our Git\+Hub project}} for changelog for each release version.\hypertarget{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2070}{}\doxysection{License}\label{md_sfcode_node_modules__nodelib_fs_stat_README_autotoc_md2070}
This software is released under the terms of the MIT license. 