Skip to content

Instantly share code, notes, and snippets.

@luisbajana
Created September 2, 2019 02:30
Show Gist options
  • Save luisbajana/766531f54b402c20361ab041e27c4b55 to your computer and use it in GitHub Desktop.
Save luisbajana/766531f54b402c20361ab041e27c4b55 to your computer and use it in GitHub Desktop.
'use strict';
const {Storage} = require('@google-cloud/storage');
const storage = new Storage();
storage
.getBuckets()
.then((results) => {
const buckets = results[0];
console.log('Buckets:');
buckets.forEach((bucket) => {
console.log(bucket.name);
});
})
.catch((err) => {
console.error('ERROR:', err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment