-
Notifications
You must be signed in to change notification settings - Fork 387
Open
Labels
api: storageIssues related to the googleapis/nodejs-storage API.Issues related to the googleapis/nodejs-storage API.samplesIssues that are directly related to samples.Issues that are directly related to samples.
Description
Please make sure you have searched for information in the following guides.
- Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues
- Check our Troubleshooting guide: https://googlecloudplatform.github.io/google-cloud-node/#/docs/guides/troubleshooting
- Check our FAQ: https://googlecloudplatform.github.io/google-cloud-node/#/docs/guides/faq
- Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples
Documentation Request
Fix misleading documentation in downloadFolderWithTransferManager.js sample
The documentation comment on line 31 of samples/downloadFolderWithTransferManager.js
is misleading:
// The ID of the GCS folder to download. The folder will be downloaded to the local path of the executing code.
However, the current implementation:
await transferManager.downloadManyFiles(folderName);
Actually returns a Buffer[] array rather than downloading files to the local filesystem as the comment suggests.
To actually download files to the local filesystem as documented, the sample should include the passthroughOptions.destination parameter:
await transferManager.downloadManyFiles(folderName, {
passthroughOptions: {
destination: `${__dirname}/`
}
});
This is correctly noted on the Transfer Manager Reference
which was how I was able to find out how I was supposed to write to the file system.

Either update the code to include the destination option, or modify the comment to accurately reflect that the current implementation returns buffers rather than writing to disk.
Metadata
Metadata
Assignees
Labels
api: storageIssues related to the googleapis/nodejs-storage API.Issues related to the googleapis/nodejs-storage API.samplesIssues that are directly related to samples.Issues that are directly related to samples.