\begin{quote}
Get the \href{https://github.com/sindresorhus/callsites\#api}{\texttt{ callsite}} of the caller function \end{quote}
\hypertarget{md_sfcode_node_modules_caller_callsite_readme_autotoc_md4954}{}\doxysection{Install}\label{md_sfcode_node_modules_caller_callsite_readme_autotoc_md4954}

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

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

\begin{DoxyCode}{0}
\DoxyCodeLine{// foo.js}
\DoxyCodeLine{const callerCallsite = require('caller-\/callsite');}
\DoxyCodeLine{}
\DoxyCodeLine{module.exports = () => \{}
\DoxyCodeLine{    console.log(callerCallsite().getFileName());}
\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_callsite_readme_autotoc_md4956}{}\doxysection{API}\label{md_sfcode_node_modules_caller_callsite_readme_autotoc_md4956}
\hypertarget{md_sfcode_node_modules_caller_callsite_readme_autotoc_md4957}{}\doxysubsection{caller\+Callsite()}\label{md_sfcode_node_modules_caller_callsite_readme_autotoc_md4957}
Returns a \href{https://github.com/sindresorhus/callsites\#api}{\texttt{ {\ttfamily callsite}}} object.\hypertarget{md_sfcode_node_modules_caller_callsite_readme_autotoc_md4958}{}\doxysection{License}\label{md_sfcode_node_modules_caller_callsite_readme_autotoc_md4958}
MIT © \href{https://sindresorhus.com}{\texttt{ Sindre Sorhus}} 