[jq] Read multiple JSON values into an array

Created on November 30, 2026

Use -s or --slurp to read all input JSON values into a single array. jq then runs the filter once on that array.

printf '%s\n' '{"name":"Taro"}' '{"name":"Hanako"}' | jq -s '.'
[
  {
    "name": "Taro"
  },
  {
    "name": "Hanako"
  }
]

Without slurping, jq runs the filter separately for each input value.

jq