title: Pipe is not a function
body: <p>I have a function that returns a stream and I want to pipe that value to another function then return it in an Express response like so:</p>
  <pre><code>const { Duplex } = require('stream');
  const request = require('request');
  
  const example = async function getRequest() {
    return request({ blah }).pipe(Duplex);
  };
  
  const secondExample = async function getRequestSecond() {
    return example().pipe(Duplex);
  };
  
  router.get('/', async (req, res) =&gt; {
    return secondExample().pipe(res);
  });
  </code></pre>
  <p>These functions all sit in different classes, but the general idea is the same. My understanding of Streams leads me to believe that piping the data to a Duplex stream and returning that should allow me to pipe it all the way down to the response, but at the <code>secondExmaple</code> function and in the <code>router.get</code> function I start to get <code>TypeError: secondExample(...).pipe is not a function</code> and I'm not understanding why.</p>