firebase storage delete entire folder
const gcs = require('@google-cloud/storage')();
const functions = require('firebase-functions');
...
const bucket = gcs.bucket(functions.config().firebase.storageBucket);
return bucket.deleteFiles({
prefix: `users/${userId}/`
}, function(err) {
if (err) {
console.log(err);
} else {
console.log(`All the Firebase Storage files in users/${userId}/ have been deleted`);
}
});