@lingua/debug-stack
v1.0.1
Published
Parses stack traces and provides a broken down stack/call location
Downloads
1
Readme
Parses stack traces and provides a broken down stack/call location
The broken down call stacks look like this:
[
{
"function": "foo",
"file": "foo.js",
"line": 20,
"col": 12
}
]
Note: This is intended as a debugging utility only, and not for use in production
Usage:
$ npm install @lingua/debug-stack
const debugStack = require('@lingua/debug-stack');
// Get the current call location as a single object
debugStack.getCallPosition();
// Get the current call location as a full stack trace (array)
debugStack.getStackTrace();
// Parse a stack trace from an existing error object
const error = new Error();
debugStack.parseStackTrace(error.stack);