←back to thread

115 points graderjs | 1 comments | | HN request time: 0.208s | source
Show context
andreareina ◴[] No.25005050[source]
Could use an example of the database file and diffs.

I have vague recollections of a tool that was similarly supposed to make JSON files diffable. IIRC it procedurally built up the object, so {"foo": {"bar": "baz", "quux": [1, 2, 3]}} would be:

    foo = {}
    foo.bar = "baz"
    foo.baz = []
    foo.baz[0] = 1
    ...
replies(3): >>25005118 #>>25005451 #>>25005522 #
PowerfulWizard ◴[] No.25005118[source]
This is called gron, I prefer it for reading JSON with a lot of nesting.

https://github.com/tomnomnom/gron

replies(2): >>25005274 #>>25005506 #
1. divbzero ◴[] No.25005506[source]
This is really cool. Gives you much of what jq does without having to remember jq syntax.