title: Stream write stream to read stream
body: <p>I am using a library in nodejs that can read from a read stream.  I am currently opening a file read stream and passing that to the lib.  However I also need to create the file on the filesystem that I am reading from.  So step 1 is to create a write file stream and stream my data to the file.</p>
  
  <ol>
  <li>data write stream -----> file</li>
  <li>http response &lt;------ read stream file</li>
  </ol>
  
  <p>The thing I don't like about this process is that I have to clean up the file system when I am done.  Is there a way the I can write directly to a read stream and do it all in one step?</p>
  
  <p><strong>EDIT:</strong>
  Concrete example (using <a href="https://github.com/ctalkington/node-archiver" rel="nofollow">https://github.com/ctalkington/node-archiver</a>):</p>
  
  <pre><code>// some route
  function(req, res, next) {
      var archive = archiver('zip');
      res.attachment("icons.zip");
      archive.pipe(res);
  
      // I have to create files on file system
      var stream1 = fs.createWriteStream("file1.txt");
      var stream2 = fs.createWriteStream("file2.txt");
      ...
      // all stuff is one streaming to file system
  
      // now stream stuff from file system to archive
      archive
        .append(fs.createReadStream("file1.txt"), { name: 'file1.txt' })
        .append(fs.createReadStream("file2.txt"), { name: 'file2.txt' })
        .finalize();
  
  }
  </code></pre>
  
  <p>I have no idea how to avoid streaming to file system first.</p>
  
  <p>EDIT: </p>
  
  <p>Simple question is really this:</p>
  
  <p>Can I write to a readable stream?</p>