https://github.com/rimiti/google-gcs-examples
Simple NodeJS examples to demonstrate how to use GCS.
https://github.com/rimiti/google-gcs-examples
gcs google google-cloud-platform google-cloud-storage nodejs
Last synced: about 2 months ago
JSON representation
Simple NodeJS examples to demonstrate how to use GCS.
- Host: GitHub
- URL: https://github.com/rimiti/google-gcs-examples
- Owner: rimiti
- License: mit
- Created: 2018-09-28T06:47:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-28T07:54:15.000Z (over 7 years ago)
- Last Synced: 2025-08-24T10:06:11.452Z (10 months ago)
- Topics: gcs, google, google-cloud-platform, google-cloud-storage, nodejs
- Language: JavaScript
- Homepage: https://dimsolution.com
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# google-gcs-examples
Simple example to demonstrate how to use Google Cloud Storage (GCS) service.
## Features
- Upload file
- Download file
- Remove file
- Get file informations
## Installation
```bash
$ yarn @rimiti/google-gcs-examples
```
## How to use it?
```
$ import * as gcs from '@rimiti/google-gcs-examples';
// Uploading file
gcs.upload(bucket, file)
.then(() => console.log('Upload done.')
.catch((e) => console.error('Error during upload', e);
// Downloading file
gcs.download(bucket, filename, destination)
.then(() => console.log('Download done.')
.catch((e) => console.error('Error during download', e);
// Removing file
gcs.remove(bucket, filename)
.then(() => console.log('Remove done.')
.catch((e) => console.error('Error during remove', e);
// Retrieving file information
gcs.getFileInformations(bucket, filename)
.then((informations) => console.log(informations)
.catch((e) => console.error('Error during retrieve', e);
```
## License
MIT © [Dimitri DO BAIRRO](https://github.com/rimiti)