MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / listBuckets

Function listBuckets

auth/auth.js:32–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 const storage = new Storage();
31 // Makes an authenticated API request.
32 async function listBuckets() {
33 try {
34 const results = await storage.getBuckets();
35
36 const [buckets] = results;
37
38 console.log('Buckets:');
39 buckets.forEach(bucket => {
40 console.log(bucket.name);
41 });
42 } catch (err) {
43 console.error('ERROR:', err);
44 }
45 }
46 listBuckets();
47 // [END auth_cloud_implicit]
48};

Callers 2

authCloudImplicitFunction · 0.85
authCloudExplicitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected