gcs-utils

1.0.1 • Public • Published

gcs-utils (Google Cloud Storage)

Utility class for easy integration with Google Cloud Storage API for File Storage and Retrieval.

Underneath uses the official @google-cloud/storage library. If you need all the features consider using the official library.

Available features

  • Create Bucket
  • Upload file
  • Download file
  • Delete file
  • Get metadata

Usage

Install:

$ npm install gcs-utils --save

or

$ yarn add gcs-utils

Instance and use:

Create private key and store it in a safe place. See more in https://cloud.google.com/iam/docs/creating-managing-service-account-keys

const GCS = require('gcs-utils')
 
const gcs = new GCS('./data/gc-key.json', 'default-bucket-name')
 
const result = await gcs.uploadFile('./data/image.jpg')
console.log('result: ', result)

See more in examples

Package Sidebar

Install

npm i gcs-utils

Weekly Downloads

8

Version

1.0.1

License

MIT

Unpacked Size

10.3 kB

Total Files

5

Last publish

Collaborators

  • discovery-tecnologia