title: Node JS Response parsing (of S3 Select response)
body: <p>I am trying to parse a response from an API which is a streamed response: but the structure looks different from any other response.
  A sample can be found  in <a href="https://aws.amazon.com/blogs/storage/querying-data-without-servers-or-databases-using-amazon-s3-select/" rel="nofollow noreferrer">python</a>.</p>
  <pre><code> let body = []
  
        response.on('data', function(chunk) {
          body.push(chunk)
        })
          .on('end', function() {
  
            const bff = Buffer.concat(body).toString(&quot;utf-8&quot;)
            console.log( bff)
  
          })
  </code></pre>
  <p>it returns like:</p>
  <pre><code>�U
  :content-typeapplication/octet-stream
                                       :event-typeRecordsJane,(949) 123-45567,Chicago,Developer
  :content-typtext/xml
                      :event-typeStats&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;Stats&gt;&lt;BytesScanned&gt;339&lt;/Byt:message-typeeventocessed&gt;339&lt;/BytesProcessed&gt;&lt;BytesReturned&gt;39&lt;/BytesReturned&gt;&lt;/Stats&gt;�h�8(�Ƅ�
                    :event-typeEndϗӒ
  
  </code></pre>
  <p>what is the correct way to parse such a response?</p>