title: How to clone a readable stream
body: <p>I have a stream i am trying to submit the same stream to two different destinations. The first destination is to AWS S3, the second destination is to some other backend via a http request.</p>
  
  <pre><code>const document = fs.createReadStream(process.cwd() + "/test/resources/" + "id/document.jpg");
  
  const s3Response = await submitToS3(document);
  
  const backendResponse = await submitToBackend(document);
  </code></pre>
  
  <p>From what i understand a stream can only be read once. How can i send the same stream to two different destinations. </p>
  
  <p>I thought about cloning the stream but simply creating a new variable and assigning the stream to that variable does not work.</p>