1.0.1 • Published 7 years ago

@lingua/debug-stack v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
7 years ago

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);