Socket
Book a DemoInstallSign in
Socket

@flystorage/google-cloud-storage

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flystorage/google-cloud-storage

1.1.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Flystorage adapter for AWS S3

This package contains the Flystorage adapter for Google Cloud Storage

Installation

Install all the required packages

npm install --save @flystorage/file-storage @flystorage/google-cloud-storage @google-cloud/storage

Usage

import {FileStorage} from '@flystorage/file-storage';
import {GoogleCloudStorageStorageAdapter} from '@flystorage/google-cloud-storage';
import {Storage} from '@google-cloud/storage';

const client = new Storage();
const bucket = client.bucket('{bucket-name}}', {
    userProject: '{user-project}}',
});
const adapter = new GoogleCloudStorageStorageAdapter(bucket, {
    prefix: '{optional-path-prefix}',
});
const storage = new FileStorage(adapter);

⚠️ Always use the FileStorage, it is essential for security and a good developer experience. Do not use the adapter directly.

Visibility

Setting an retrieving visibility is only meaningful for legacy buckets. To use this functionality with Flystorage, pass the legacy visibility handling to the constructor:

import {GoogleCloudStorageStorageAdapter, LegacyVisibilityHandling} from '@flystorage/google-cloud-storage';

const adapter = new GoogleCloudStorageStorageAdapter(bucket, {
    prefix: '{optional-path-prefix}',
}, new LegacyVisibilityHandling(
    'allUsers', // acl entity, optional
    'publicRead', // acl for Visibility.PUBLIC, optional,
    'projectPrivate', // acl for Visibility.PRIVATE, optional,
));

Keywords

google

FAQs

Package last updated on 13 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.