| title | stringify() |
|---|---|
| order | 4 |
You can turn a parsed object back into what the original stack trace was!
Returns a formatted stack frame (or multiple). (it is recommended you stick to a singular frame per call, but for simplicity you can also enter in the entire array and get the same output)
// get the intial array
const parsed = Stacklyn.parse(error);
// for each frame in the array, stringify it
const stackframes = parsed.map(frame => Stacklyn.stringify(frame));
// log the error
console.log(`${error.toString()}\n${stackframes.join("\n")}`);