-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Why NDJSON instead of JSON? #9068
Comments
jq should handle newline-delimited JSON fine. Are you talking about Yarn 1.x or 4.x? This repo is for 1.x, which is frozen and not getting updates. |
Sure, jq can handle NDJSON, but why pick NDJSON instead of plain JSON in the first place? It just seems a weird decision given the fact that NDJSON is not that common and, albeit jq handling it properly, there most probably are ton of other tools that wont handle NDJSON. I believe the output of this particular command is the same for 1.x and 4.x. |
When there is a large amount of data, I've found that it can be a challenge to efficiently handle the JSON file in code, because the choices I've seen are either:
NDJSON (or JSON Lines, as I think is now the new name), solves this problem by allowing me to easily take in a single object at a time by reading lines in the file. Parsing/splitting lines has been trivial in any development environment/stack that I've worked with. Am trying to think of a scenario where you would be coordinating the run of I would love to discuss the scenarios where NDJSON is proving problematic for you. |
yarn info
(and others?) output NDJSON instead of JSON and I can't find a reason why you'd have picked NDJSON instead of JSON.JSON is already very easily parseable with
jq
and the size increase in the output is negligible compared to NDJSON. Maybe switch to JSON and make it easier to parse yarn's output?The text was updated successfully, but these errors were encountered: