Gathering detailed insights and metrics for caller-path
Gathering detailed insights and metrics for caller-path
npm install caller-path
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.6
Supply Chain
93.6
Quality
75.4
Maintenance
100
Vulnerability
100
License
JavaScript (85.32%)
TypeScript (14.68%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
2,964,156,693
Last Day
1,242,850
Last Week
8,061,964
Last Month
29,575,981
Last Year
337,496,869
MIT License
64 Stars
19 Commits
11 Forks
7 Watchers
1 Branches
5 Contributors
Updated on Jan 07, 2025
Minified
Minified + Gzipped
Latest Version
4.0.0
Package Id
caller-path@4.0.0
Size
2.07 kB
NPM Version
7.20.3
Node Version
16.10.0
Published on
Oct 08, 2021
Cumulative downloads
Total Downloads
Last Day
-17.5%
1,242,850
Compared to previous day
Last Week
15.8%
8,061,964
Compared to previous week
Last Month
52.9%
29,575,981
Compared to previous month
Last Year
-15.2%
337,496,869
Compared to previous year
1
4
Get the path of the caller function
1npm install caller-path
1// foo.js 2import callerPath from 'caller-path'; 3 4export default function foo() { 5 console.log(callerPath()); 6 //=> '/Users/sindresorhus/dev/unicorn/bar.js' 7}
1// bar.js 2import foo from './foo.js'; 3foo();
If the caller's callsite object getFileName
was not defined for some reason, it will return undefined
.
Get the path of the caller function.
Type: number
Default: 0
The caller path depth, meaning how many levels we follow back on the stack trace.
For example:
1// foo.js 2import callerPath from 'caller-path'; 3 4export default function foo() { 5 console.log(callerPath()); 6 //=> '/Users/sindresorhus/dev/unicorn/foobar.js' 7 console.log(callerPath({depth: 1})); 8 //=> '/Users/sindresorhus/dev/unicorn/bar.js' 9 console.log(callerPath({depth: 2})); 10 //=> '/Users/sindresorhus/dev/unicorn/foo.js' 11}
1// bar.js 2import foo from './foo.js'; 3 4export default function bar() { 5 foo(); 6}
1// foobar.js 2import bar from './bar.js'; 3bar();
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 4/19 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More