@google-cloud-suite/cloud-functions-storage-upload
v0.0.37
Published
@google-cloud-suite/cloud-functions-storage-upload
Downloads
5
Readme
@google-cloud-suite/cloud-functions-storage-upload
Upload file to storage via functions
- Install
npm install @google-cloud-suite/cloud-functions-cloud-functions-storage-upload
- Handle stroage trigger
You can use handle(params?: InitParams)
to initialize trigger. The followings are the property of InitParams:
- bucketName: string
- clientSecret?: string
- defaults:
undefined
- defaults:
- keyPrefix?: string
- defaults:
undefined
- defaults:
Examples:
- Using event target bucket for both source and destination.
const storageUpload = require("@google-cloud-suite/cloud-functions-storage-upload");
exports.upload = storageUpload.handle();
- Deploy
gcloud functions deploy upload \
--runtime nodejs14 \
--project YOUR_PROJECT