Skip to content

Commit

Permalink
Merge pull request #814 from neilcronin/master
Browse files Browse the repository at this point in the history
update docs to reflect actual events that are fired from a stream cre…
  • Loading branch information
stephenplusplus committed Aug 19, 2015
2 parents e0b3679 + 25aa273 commit be39f58
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/storage/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,17 +387,18 @@ File.prototype.move = function(destination, callback) {
* //-
* var fs = require('fs');
* var myBucket = gcs.bucket('my-bucket');
* var image = myBucket.file('image.png');
* var remoteFile = myBucket.file('image.png');
* var localFilename = '/Users/stephen/Photos/image.png';
*
* image.createReadStream()
* .pipe(fs.createWriteStream('/Users/stephen/Photos/image.png'))
* remoteFile.createReadStream()
* .on('error', function(err) {})
* .on('response', function(response) {
* // Server connected and responded with the specified status and headers.
* })
* .on('complete', function() {
* // The file is fully downloaded.
* });
* })
* .pipe(fs.createWriteStream(localFilename));
*
* //-
* // To limit the downloaded data to only a byte range, pass an options object.
Expand All @@ -407,8 +408,8 @@ File.prototype.move = function(destination, callback) {
* start: 10000,
* end: 20000
* })
* .pipe(fs.createWriteStream('/Users/stephen/logfile.txt'))
* .on('error', function(err) {});
* .on('error', function(err) {})
* .pipe(fs.createWriteStream('/Users/stephen/logfile.txt'));
*
* //-
* // To read a tail byte range, specify only `options.end` as a negative
Expand All @@ -418,8 +419,8 @@ File.prototype.move = function(destination, callback) {
* logFile.createReadStream({
* end: -100
* })
* .pipe(fs.createWriteStream('/Users/stephen/logfile.txt'))
* .on('error', function(err) {});
* .on('error', function(err) {})
* .pipe(fs.createWriteStream('/Users/stephen/logfile.txt'));
*/
File.prototype.createReadStream = function(options) {
options = options || {};
Expand Down

0 comments on commit be39f58

Please sign in to comment.