3 ms·
Ask HN: What are you favoring YAML/JSON command line tools?
Mine is jq. Wondering if there's something similar I could use to write JSON/YAML from the command line without a need of jumping to Vim.
- dozzie 11y agoWhy would anybody bother with jq? App::RecordStream gives much more flexibility. And how would you exactly write JSON/YAML? You could generate some e.g. from CSV or with split/regexp/text parsing (recs-from*), but those are specific cases when you have some data and you want to work on it as a set on JSON objects. It's data-centric, not format-centric.
- wkoszek 11y agojq is nice for scripting and debugging. If you have a backend powered by JSON or YAML and you need to do some debugging/eyeballing, writing a custom scripts... jq is there. I guess I'll have to write my tool for this :-)
- dozzie 11y agoI still see no point in using jq instead of App::RecordStream. It's not like jq can produce JSON stream (recs-fromcsv, recs-fromdb, recs-fromsplit), consume it (recs-tocsv, recs-totable, recs-eval), or easily summarize it (recs-collate). All jq can do seems to fall under recs-grep and recs-xform.
- davelnewton 11y agocat > some_file.json What would it mean to write JSON to a file from the command line other than that?
- wkoszek 11y agoHave a tool which understands the structure and can put certain arguments from the command line into the correct hierarchy of JSON/YAML? Think: sed's 'i' command for these formats basically.