JSON Utilities such as safe JSON parser and pretty JSON stringifier.
npm install @everymundo/json-utilsparseJson will do that for you and will return the Error object in case of an Error or your parsed object in case of success.
It's also known that a function with a try-catch block in it is almost always slower than its version without a try-catch block, thus using parseJson and checking whether or not the result is an instance of Error is usually faster than using a try catch block inside your function.
JSON.stringify(variable, undefined, ' ');, calling prettyJson(variable) looks nicer;