- Published
- Author
- Syed SibtainSystem Analyst
NDJSON (Newline Delimited JSON): A file format where each line is a valid, independent JSON object, separated by a newline character (\n)
Regular JSON wraps everything in an array:
NDJSON is one object per line, no wrapper:
Didn't know this existed. Turns out it's really useful for:
- Log files — each event is one line, easy to grep
- Streaming APIs — send objects as they're ready, don't wait for the full array
- Large datasets — process line by line without loading everything into memory
Also called JSONL (JSON Lines). Same thing. Claude Code uses this to send MCP messages over stdio
#json
Regular JSON wraps everything in an array:
Code
[
{"name": "Alice"},
{"name": "Bob"}
]NDJSON is one object per line, no wrapper:
Code
{"name": "Alice"}
{"name": "Bob"}Didn't know this existed. Turns out it's really useful for:
- Log files — each event is one line, easy to grep
- Streaming APIs — send objects as they're ready, don't wait for the full array
- Large datasets — process line by line without loading everything into memory
Also called JSONL (JSON Lines). Same thing. Claude Code uses this to send MCP messages over stdio
#json