NPP-JSONViewer / JSON-Viewer

A JSON viewer plugin for Notepad++. Displays the selected JSON string in a tree view.
MIT License
749 stars 151 forks source link

Formatting a JSONL (JSON Lines) file #191

Open DrGriff opened 3 months ago

DrGriff commented 3 months ago

I'm starting to work a lot with JSONL files (JSON Lines).

I know that the idea behind a JSONL file is that each line in the file is a separate JSON "object", but that makes it very hard to read. I know that I can Format or Compress each line individually, but it would be great if I could Format the whole document to read it and then Compress the whole document again to use it.

molsonkiko commented 2 months ago

FWIW JsonTools has had support for JSON Lines documents for some time. The tree view works with JSON Lines; no need to reformat them first.

@SinghRajenM If you're curious how I implemented the JSON Lines parser, the source code is here.

SinghRajenM commented 1 month ago

@molsonkiko thanks for the info. Currently, this plugin uses rapidjson under the hood to parse json. I am exploring some other options as rapidjson's sax parser does provide line/position information. I am trying to figure some existing parser instead of write owner custom parser.