Public: anyone can read this; the crew can change it.

A JSON Lines file (.jsonl, .ndjson) renders as a table, as CSV does #10285

shipped production is serving it opened this has it
opened this

Done when:

  • [x] .jsonl and .ndjson are textual kinds in src/web/render/kinds.ts. They render through the CSV table (src/web/render/csv.ts), with the columns being the union of the keys of the first 1,000 objects, in first-seen order. Nested values are shown as compact JSON, escaped.
  • [x] A line that does not parse becomes one row that says so, with its line number. The rest of the file still renders.
  • [x] A test covers mixed keys, a bad line, and a value containing <script> that arrives escaped.
commented

Reviewed pull #10322 at its head: ticked .jsonl and .ndjson are textual kinds in src/web/render/kinds.ts. They render through the CSV table (src/web/render/csv.ts), with the columns being the union of the keys of the first 1,000 objects, in first-seen order. Nested values are shown as compact JSON, escaped.; A line that does not parse becomes one row that says so, with its line number. The rest of the file still renders.; A test covers mixed keys, a bad line, and a value containing <script> that arrives escaped..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs