-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is supporting pretty printed (multi line) JSON worthwhile? #1
Comments
Sorry for my late answer. I think we could drop PrettyPrint support because the parser doesn't need to be JSON aware in this case. |
If we don't support PrettyPrint JSON we can use \n as line delimiter instead of \r\n What is your opinion? \cc @chrisdew |
Yes, I'd be happy to drop pretty print support. I've always thought that we should output \n (0x0a) as the separator, but be tolerant of '\r\n' on input. I don't understand how the choice of separator is linked with pretty print support. |
The problem with pretty print support is, that we need a stream parser to find JSON objects. If we use one line JSON only we can split at newlines without parsing the JSON. |
It's recently occured to me that you can have pretty printing in line delimited json if you use The only (slight) difficulty is |
* update rfc links * update obsoleted RFCs (#1) Co-authored-by: Jesse Jackson <jsejcksn@users.noreply.github.com>
pros:
cons:
JSON.parse
isn't so clever in practise (I do have a work around, but the implementation is not trivial and trivial implementation is a major point using Line Delimited JSON).The text was updated successfully, but these errors were encountered: