Gathering detailed insights and metrics for @alloc/caller-path
Gathering detailed insights and metrics for @alloc/caller-path
Gathering detailed insights and metrics for @alloc/caller-path
Gathering detailed insights and metrics for @alloc/caller-path
npm install @alloc/caller-path
Typescript
Module System
Min. Node Version
Node Version
NPM Version
66.6
Supply Chain
94.5
Quality
75
Maintenance
100
Vulnerability
100
License
JavaScript (84.23%)
TypeScript (15.77%)
Total Downloads
522
Last Day
1
Last Week
1
Last Month
8
Last Year
94
MIT License
17 Commits
1 Watchers
2 Branches
1 Contributors
Updated on Apr 14, 2021
Minified
Minified + Gzipped
Latest Version
3.0.0
Package Id
@alloc/caller-path@3.0.0
Unpacked Size
5.00 kB
Size
2.18 kB
File Count
5
NPM Version
6.14.8
Node Version
14.13.1
Cumulative downloads
Total Downloads
1
Get the path of the caller function
Important: You have to use 'use strict';
in your code for this module to work correctly, or make sure the module is an ESM module, which is implicitly strict.
Fork that includes https://github.com/sindresorhus/caller-path/pull/9
$ npm install caller-path
1// foo.js 2const callerPath = require('caller-path'); 3 4module.exports = () => { 5 console.log(callerPath()); 6 //=> '/Users/sindresorhus/dev/unicorn/bar.js' 7}
1// bar.js 2const foo = require('./foo'); 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 2const callerPath = require('caller-path'); 3 4module.exports = () => { 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 2const foo = require('./foo'); 3 4module.exports = () => { 5 foo(); 6}
1// foobar.js 2const bar = require('./bar'); 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
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 0/17 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
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
Score
Last Scanned on 2025-06-23
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 MoreLast Day
0%
1
Compared to previous day
Last Week
0%
1
Compared to previous week
Last Month
-11.1%
8
Compared to previous month
Last Year
-10.5%
94
Compared to previous year