nodestream-gcs
Google Cloud Storage adapter for Nodestream
Identity:: gcs
Description
This adapter provides interface for Nodestream to transfer bytes between your app and Google Cloud Storage.
Usage
Installation
npm install --save nodestream-gcs
Configuration
When configuring Nodestream instance, you must specify at minimum the bucket
on which you want to operate, and, as per GCS documentation, at least projectId
, but preferably also keyFilename
to have fully authenticated client functionality. All configuration options are passed along unmodified to the gcloud()
function. No default values are provided.
const Nodestream = const nodestream = adapter: 'gcs' config: bucket: 'my-gcs-bucket' projectId: 'project-id-123' keyFilename: '/path/to/keyfile.json'
Uploading
When uploading files, you may specify a directory
and name
for the upload. Both are optional - if no name
is given, a random GUID will be generated.
You can also specify options for the createWriteStream()
method via gcs
object (this adapter's identity).
const file = fsnodestream
Downloading
You can also specify options for the createReadStream()
method via gcs
object (this adapter's identity) in the third argument.
const dest = fsnodestream // Perhaps in an Express controller, you would pipe the file to the clientresresnodestream
License
This software is licensed under the BSD-3-Clause License. See the LICENSE file for more information.