API在Cloud
Storage节点SDK的2.x版本中进行了更改。根据文档,您可以这样导入SDK:
// imports the Google Cloud client libraryconst {Storage} = require('@google-cloud/storage');
然后,您可以创建一个新的存储对象:
// Creates a clientconst storage = new Storage({ projectId: projectId,});
然后您可以进入一个桶:
const bucket = storage.bucket()



