Answer the question
In order to leave comments, you need to log in
How is it "convenient" to open a JSON file?
How can I display a json record in a convenient form?
To have indents, etc. In other words, to make the data easy to read.
Answer the question
In order to leave comments, you need to log in
Firefox can format JSON out of the box, for example. For your editor, look for a plugin that can do pretty print for JSON.
First result on google https://jsonformatter.org/json-pretty-print
If you do not need to do any complex transformations, then you can use JSON.stringify()
, whose third argument is a string type separator, which is substituted before each line, taking into account nesting.
in browser
var data = {"test":1,"test2":[{"test3":3},{"test4":4}]};
var s = JSON.stringify(data,"\n",4);
{
"test": 1,
"test2": [
{
"test3": 3
},
{
"test4": 4
}
]
}
Try this. At the same time, you will tell me the result.
w2ui.com/web/demos/#!grid/grid-5
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question