\begin{quote}
Get callsites from the \href{https://github.com/v8/v8/wiki/Stack-Trace-API}{\texttt{ V8 stack trace API}} \end{quote}
\hypertarget{md_sfcode_node_modules_callsites_readme_autotoc_md4970}{}\doxysection{Install}\label{md_sfcode_node_modules_callsites_readme_autotoc_md4970}

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

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

\begin{DoxyCode}{0}
\DoxyCodeLine{const callsites = require('callsites');}
\DoxyCodeLine{}
\DoxyCodeLine{function unicorn() \{}
\DoxyCodeLine{    console.log(callsites()[0].getFileName());}
\DoxyCodeLine{    //=> '/Users/sindresorhus/dev/callsites/test.js'}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{unicorn(); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_callsites_readme_autotoc_md4972}{}\doxysection{API}\label{md_sfcode_node_modules_callsites_readme_autotoc_md4972}
Returns an array of callsite objects with the following methods\+:


\begin{DoxyItemize}
\item {\ttfamily get\+Type\+Name}\+: returns the type of this as a string. This is the name of the function stored in the constructor field of this, if available, otherwise the object\textquotesingle{}s \mbox{[}\mbox{[}Class\mbox{]}\mbox{]} internal property.
\item {\ttfamily get\+Function\+Name}\+: returns the name of the current function, typically its name property. If a name property is not available an attempt will be made to try to infer a name from the function\textquotesingle{}s context.
\item {\ttfamily get\+Method\+Name}\+: returns the name of the property of this or one of its prototypes that holds the current function
\item {\ttfamily get\+File\+Name}\+: if this function was defined in a script returns the name of the script
\item {\ttfamily get\+Line\+Number}\+: if this function was defined in a script returns the current line number
\item {\ttfamily get\+Column\+Number}\+: if this function was defined in a script returns the current column number
\item {\ttfamily get\+Eval\+Origin}\+: if this function was created using a call to eval returns a Call\+Site object representing the location where eval was called
\item {\ttfamily is\+Toplevel}\+: is this a top-\/level invocation, that is, is this the global object?
\item {\ttfamily is\+Eval}\+: does this call take place in code defined by a call to eval?
\item {\ttfamily is\+Native}\+: is this call in native V8 code?
\item {\ttfamily is\+Constructor}\+: is this a constructor call?
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_callsites_readme_autotoc_md4973}{}\doxysection{License}\label{md_sfcode_node_modules_callsites_readme_autotoc_md4973}
MIT © \href{https://sindresorhus.com}{\texttt{ Sindre Sorhus}} 