Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 675 Bytes

File metadata and controls

23 lines (18 loc) · 675 Bytes
title stringify()
order 4

Stringify a stack trace

You can turn a parsed object back into what the original stack trace was!

Stacklyn.stringify(frame: object|object[])

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)

Example

// 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")}`);