I would like a JSON-like printer to recognize when an array or object fits on one line, and just do it. Example:
{
"fits": ["JSON", "pretty", "printer"],
"longer": [
"???????????????????????????????????????????????????",
"???????????????????????????????????????????????????",
"???????????????????????????????????????????????????",
"???????????????????????????????????????????????????",
"???????????????????????????????????????????????????"
]
}
Is there a separate library? If not, how would I start writing?
What interests me most is the JavaScript implementation.
source
share