79118319

Date: 2024-10-23 14:20:31
Score: 1
Natty:
Report link

As of @google-cloud/storage v7.10.0 (2024-04-15) it is now possible to create a file object from an URL.

Docs

Example:

import { Storage, File } from '@google-cloud/storage';

const storage = new Storage();

const uri = 'gs://example-bucket/example-file';

const file = File.from(uri, storage).download();
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Andreas Kjellqvist