morgan-body
morgan-body copied to clipboard
How to set the indent of JSON.stringify?
When I use morgan-body
, the indent is somehow set tot 8 spaces. I want to change it to 2 spaces but don't know how to do that.
The only way that works for me is to overwrite the original JSON.stringify
.
const originalStringify = JSON.stringify;
JSON.stringify = function(value, replacer = null) {
return originalStringify(value, replacer, 2);
};
ah - no one has asked for this one, feel free to add it as an option with a pull request