Gathering detailed insights and metrics for callsites
Gathering detailed insights and metrics for callsites
Gathering detailed insights and metrics for callsites
Gathering detailed insights and metrics for callsites
npm install callsites
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
260 Stars
37 Commits
22 Forks
9 Watching
1 Branches
7 Contributors
Updated on 08 Nov 2024
JavaScript (53.98%)
TypeScript (46.02%)
Cumulative downloads
Total Downloads
Last day
-7.4%
8,988,560
Compared to previous day
Last week
-0.1%
52,255,424
Compared to previous week
Last month
11.1%
217,948,333
Compared to previous month
Last year
10.9%
2,248,209,542
Compared to previous year
Get callsites from the V8 stack trace API
1npm install callsites
1import callsites from 'callsites'; 2 3function unicorn() { 4 console.log(callsites()[0].getFileName()); 5 //=> '/Users/sindresorhus/dev/callsites/test.js' 6} 7 8unicorn();
Returns an array of callsite objects with the following methods:
getThis
: Returns the value of this
.getTypeName
: 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's [[Class]]
internal property.getFunction
: Returns the current function.getFunctionName
: 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's context.getMethodName
: Returns the name of the property of this
or one of its prototypes that holds the current function.getFileName
: If this function was defined in a script returns the name of the script.getLineNumber
: If this function was defined in a script returns the current line number.getColumnNumber
: If this function was defined in a script returns the current column numbergetEvalOrigin
: If this function was created using a call to eval
returns a string representing the location where eval
was called.isToplevel
: Returns true
if this is a top-level invocation, that is, if it's a global object.isEval
: Returns true
if this call takes place in code defined by a call to eval
.isNative
: Returns true
if this call is in native V8 code.isConstructor
: Returns true
if this is a constructor call.isAsync()
: Returns true
if this call is asynchronous (i.e. await
, Promise.all()
, or Promise.any()
).isPromiseAll()
: Returns true
if this is an asynchronous call to Promise.all()
.getPromiseIndex()
: Returns the index of the promise element that was followed in Promise.all()
or Promise.any()
for async stack traces, or null
if the CallSite
is not an asynchronous Promise.all()
or Promise.any()
call.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 10/29 approved changesets -- score normalized to 3
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
detected GitHub workflow tokens with excessive permissions
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 2024-11-18
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