title: event associated with fs.createWriteStream in node.js
body: <p>What event is triggered when EOF is reached while writing to a stream ?
  My code is as follows. and it is as per <a href="http://docs.nodejitsu.com/articles/advanced/streams/how-to-use-fs-create-write-stream">http://docs.nodejitsu.com/articles/advanced/streams/how-to-use-fs-create-write-stream</a></p>
  
  <p>But surprisingly my 'end' event is never fired. When I checked <a href="http://nodejs.org/api/stream.html#stream_event_end">http://nodejs.org/api/stream.html#stream_event_end</a>, I see that writable stream does not have any event on 'end'</p>
  
  <hr>
  
  <pre><code>var x = a1.jpg;
  var options1 = {'url': url_of_an_image, 'encoding': null};
  var r = request(options1).pipe(fs.createWriteStream('/tmp/imageresize/'+x));
  
  r.on('end', function(){
      console.log('file downloaded to ', '/tmp/imageresize/'+x);
  }
  </code></pre>
  
  <p>How do I capture the EOF event ?</p>