Created
September 2, 2019 02:30
-
-
Save luisbajana/766531f54b402c20361ab041e27c4b55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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