npm install where-call
- whereIsCallFunction(): Info | null
// source.js
function foo() {
return whereIsCallFunction();
}
const location = foo();
// │ ↑
// └───────┘
// source.js:4:17
- whereIsHere(): Info | null
// source.js
function foo() {
const location = whereIsHere();
// │ ↑
// └───────┘
// source.js:2:19
}
foo();
- Info: location detail
- line: number
- column: number
- file: string
- stack-utils cleans stack traces and parse trace info