我有 Google Cloud Storage 中对象的
gs://
字符串 URI(有关 gs://
URI 含义的解释,请参阅 这个问题)。 如何使用 Node.js 下载这些对象? docs 仅包含带有存储桶名称和文件路径的示例:
const {Storage} = require('@google-cloud/storage');
const storage = new Storage();
const myBucket = storage.bucket('my-bucket');
const file = myBucket.file('my-file');
我可以直接从
file
URI(作为字符串传递)创建 gs://
,还是需要手动将 URI 解析为存储桶名称和文件路径?