title: Upload a file stream to S3 without a file and from memory
body: <p>I'm trying to create a csv from a string and upload it to my S3 bucket. I don't want to write a file. I want it all to be in memory.</p>
  
  <p>I don't want to read from a file to get my stream. I would like to make a stream with out a file. I would like this method <code>createReadStream</code>, but instead of a file, I would like to pass a string with my stream's contents.</p>
  
  <pre><code>var AWS      = require('aws-sdk'),
      zlib     = require('zlib'),
      fs       = require('fs');
      s3Stream = require('s3-upload-stream')(new AWS.S3()),
  
  // Set the client to be used for the upload. 
  AWS.config.loadFromPath('./config.json');
  
  // Create the streams 
  var read = fs.createReadStream('/path/to/a/file');
  var upload = s3Stream.upload({
    "Bucket": "bucket-name",
    "Key": "key-name"
  });
  
  // Handle errors. 
  upload.on('error', function (error) {
    console.log(error);
  });
  
  upload.on('part', function (details) {
    console.log(details);
  });
  
  upload.on('uploaded', function (details) {
    console.log(details);
  });
  
  read.pipe(upload);
  </code></pre>