Hacker News new | ask | show | jobs
by ianburrell 681 days ago
JSONL is pretty common format. It makes sense for logs and anything else written incrementally.

JSON parsers are super common. They are simpler and faster than CSV because it is more regular. JSONL is simple to implement cause write by record and read by line.

The only difference with CSV are bracket characters around line and every string has quotes. The benefit is clear escaping rules including for newlines.

1 comments

JSONL is standard. Upthread said to write the header row and then make subsequent rows arrays. Of which I am not aware of anything that does this currently.

My objection to JSONL was about the increase in file size owing to repeating the keys.

JSON can write arrays in addition to hashes. JSON arrays are nearly identical to CSV. The only difference is brackets around li;es. There is no extra space wasted for keys.