\begin{quote}
Get the path of the caller function \end{quote}
\hypertarget{md_sfcode_node_modules_caller_path_readme_autotoc_md4960}{}\doxysection{Install}\label{md_sfcode_node_modules_caller_path_readme_autotoc_md4960}

\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install -\/-\/save caller-\/path }

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

\begin{DoxyCode}{0}
\DoxyCodeLine{// foo.js}
\DoxyCodeLine{const callerPath = require('caller-\/path');}
\DoxyCodeLine{}
\DoxyCodeLine{module.exports = () => \{}
\DoxyCodeLine{    console.log(callerPath());}
\DoxyCodeLine{    //=> '/Users/sindresorhus/dev/unicorn/bar.js'}
\DoxyCodeLine{\} }

\end{DoxyCode}



\begin{DoxyCode}{0}
\DoxyCodeLine{// bar.js}
\DoxyCodeLine{const foo = require('./foo');}
\DoxyCodeLine{foo(); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_caller_path_readme_autotoc_md4962}{}\doxysection{License}\label{md_sfcode_node_modules_caller_path_readme_autotoc_md4962}
MIT © \href{https://sindresorhus.com}{\texttt{ Sindre Sorhus}} 