title: jq to output results as JSON
body: <p><code>jq</code> is suppose to </p>
  
  <blockquote>
    <p>process/filter JSON inputs and producing the filter's results <strong><em>as JSON</em></strong></p>
  </blockquote>
  
  <p>However, I found that after the <code>jq</code> process/filter, output result is no longer in JSON format any more. </p>
  
  <p>E.g., <a href="https://stedolan.github.io/jq/tutorial/#result5" rel="noreferrer">https://stedolan.github.io/jq/tutorial/#result5</a>, i.e., </p>
  
  <pre><code>$ curl -s 'https://api.github.com/repos/stedolan/jq/commits?per_page=5' | jq '.[] | {message: .commit.message, name: .commit.committer.name}'
  {
    "message": "Merge pull request #162 from stedolan/utf8-fixes\n\nUtf8 fixes. Closes #161",
    "name": "Stephen Dolan"
  }
  {
    "message": "Reject all overlong UTF8 sequences.",
    "name": "Stephen Dolan"
  }
  . . . 
  </code></pre>
  
  <p>Is there any workaround? </p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>How to wrap the whole return into a json structure of:</p>
  
  <pre><code>{ "Commits": [ {...}, {...}, {...} ] }
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>jq '.[] | Commits: [{message: .commit.message, name: .commit.committer.name}]'
  jq 'Commits: [.[] | {message: .commit.message, name: .commit.committer.name}]'
  </code></pre>
  
  <p>but neither works. </p>