Add refFromUrl equivalent from Firebase Web SDK #962
Labels
api: storage
Issues related to the googleapis/nodejs-storage API.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Is your feature request related to a problem? Please describe.
We're storing Cloud Storage URIs in Cloud Bigtable, and we want to be able to easily generate File references using those URIs in Cloud Functions. These URIs come from many different buckets, and we do not wish to keep these bucket objects in memory outside of the function scope.
Describe the solution you'd like
The Firebase Web SDK has exactly the method we wish for in the GCS Node SDK:
refFromUrl
. https://firebase.google.com/docs/reference/js/firebase.storage.Storage.html#reffromurlDescribe alternatives you've considered
It is possible to generate a File object reference by parsing the string, as suggested on SO. However, while this does work, I hardly consider this to be an elegant solution. I was sure there would be a way to generate a File reference from a GCS URI with one line of code. I understand that this library is entirely different than the Firebase Web SDK, serving different purposes, in different contexts, and that their only similarity is their relation to the underlying Google product. Despite this, I don't see why this library can't support features like
refFromUrl
that are useful in both contexts.Additional context
This is what I would like to be able to do
The text was updated successfully, but these errors were encountered: