1.3.0 • Published 1 month ago

@storecraft/storage-google v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

Storecraft Google Cloud Storage

Storecraft supports the Google Storage services. The service is serverless friendly. Through the @storecraft/storage-google package.

Features:

  • Works in any js runtime and platform that supports fetch
  • Supports streaming Get / Put / Delete
  • Supports presigned Get / Put requests to offload to client

How-to

  1. Create a bucket at GCP console or even at firebase
  2. Download the service json file

Use the values of the service file.

Note:

  • You can use an empty constructor and upon StoreCraft init, the platform environment variables will be used by this storage if needed.

Usage

npm i @storecraft/storage-google

then,

import { App } from '@storecraft/core';
import { GoogleStorage } from '@storecraft/storage-google';

const app = new App()
.withPlatform(new NodePlatform())
.withDatabase(new MongoDB())
.withStorage(
  new GoogleStorage(
    {
      bucket: process.env.GS_BUCKET, 
      client_email: process.env.GS_CLIENT_EMAIL, 
      private_key: process.env.GS_PRIVATE_KEY, 
      private_key_id: process.env.GS_PRIVATE_KEY_ID
    }
  )
).init();
  

config

Storecraft will search the following env variables

GS_BUCKET=...
GS_CLIENT_EMAIL=...
GS_PRIVATE_KEY=...
GS_PRIVATE_KEY_ID=...

So, you can instantiate with empty config

.withStorage(
  new GoogleStorage()
)
Author: Tomer Shalev (tomer.shalev@gmail.com)
1.0.17

2 months ago

1.0.16

2 months ago

1.2.5

2 months ago

1.3.0

1 month ago

1.0.15

3 months ago

1.0.14

3 months ago

1.0.13

3 months ago

1.0.11

4 months ago

1.0.12

3 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

6 months ago

1.0.6

7 months ago

1.0.10

4 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

9 months ago

1.0.1

10 months ago

1.0.0

1 year ago