iter-json

Iterate over a JSON array on the shell.

Usage no npm install needed!

<script type="module">
  import iterJson from 'https://cdn.skypack.dev/iter-json';
</script>

README

iter-json

Imagine you have a file with an enourmous JSON array and you want to quickly execute shell commands for each item in the array, starting at index 7 and ending at index 48.

And you have jq or similar.

And fish.

for item in (cat json-data.json | jq '.list-of-items[7:48]' | iter-json)
    set value (echo $item | jq '.somekey')
    # do something
end