The string of JSON is one line. Is there a npm package that can format it into a newline style?

for example, the string
{"errcode": 0, "errinfo": "}
can be formatted as

when displayed.
{
    "errcode":0,
    "errinfo":""
}
Is there a plug-in implementation for

?
of course not only this kind of value is a string, value may be an array or an object, is there a formatted package?

Jun.20,2022

clipboard.png


if it were me, I would choose to use pretty-format .


I don't understand. Do you mean the replacement package for JSON.parse () and JSON.stringify ()?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf34bc-46eaa.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf34bc-46eaa.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?