Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update docs to reflect actual events that are fired from a stream cre… #814

Merged
merged 3 commits into from
Aug 19, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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