UNPKG
caller-path
Version:
latest (4.0.0)
4.0.0
3.0.1
3.0.0
2.0.0
1.0.0
0.1.0
Get the path of the caller function
github.com/sindresorhus/caller-path
sindresorhus/caller-path
caller-path
/
index.js
7 lines
(5 loc)
•
191 B
JavaScript
View Raw
1
2
3
4
5
6
7
import
callerCallsite
from
'caller-callsite'
;
export
default
function
callerpath
(
{depth =
0
} = {}
) {
const
callsite =
callerCallsite
({depth});
return
callsite && callsite.
getFileName
(); }