title: Handling NodeJS streaming values before sending response to client
body: <p>How can I parse the results from <code>res</code> before sending the <code>res</code> to the client?</p>
  <p>As I understand, the results from <code>request(url)</code> will make a request to another server and stream the response data to the 2nd <code>.pipe()</code>. However, I would like to parse the response BEFORE sending the response to the client. Specifically, I want to check if the header from the response contains a specific key/value pair and also analyze the response body (<code>res.body</code>). Depending on the data in the <code>body</code> and/or <code>header</code>, I would like to return the appropriate HTTP code and/or response body</p>
  <pre><code>app.use(&quot;/path&quot;, (req, res) =&gt; {
    const url = `localhost:8000`;
    const stream = intoStream(req.body.toString());
    stream.pipe(request(url)).pipe(res);
  });
  </code></pre>