NDJSON

While exploring Elasticsearch bulk operations I ran into NDJSON (newline-delimited JSON). It is a common data file format — and simpler than I expected.

I used to dump related records as a plain .js / .json list of objects. NDJSON skips the outer array: each line is its own JSON object.

{"id": 1, "status": "ok"}
{"id": 2, "status": "failed"}
{"id": 3, "status": "ok"}

Handy for streaming and bulk APIs — you can append or process one record at a time without parsing a huge list. Pretty cool.