New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ruanitto/adonis-drive-google

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ruanitto/adonis-drive-google

Google Cloud Storage Driver for Adonis Drive

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@ruanitto/adonis-drive-google 💾

Google Cloud Storage driver for AdonisJS Drive

Requirements

  • AdonisJS Drive (adonis install @adonisjs/drive)

Installation

adonis install @ruanitto/adonis-drive-google

Instructions

Make sure to register the provider inside start/app.js file.

const providers = [
  ...
  '@ruanitto/adonis-drive-google/providers/DriveProvider'
]

Add new configuration inside disks module in config/drive.js:

gcs: {
  driver: 'gcs',
  keyFilename: Env.get('GCS_KEY_FILE_NAME'), // path to json file
  bucket: Env.get('GCS_BUCKET')
}

Add google cloud storage variables in .env:

GCS_KEY_FILE_NAME=
GCS_BUCKET=

Examples

Find if a file exists or not.

const isExists = await Drive.disk('gcs').exists('adonis.jpeg')

Change bucket

You can change bucket at runtime, just passing the bucket name before action.

const isExists = await Drive.disk('minio').bucket('new-bucket').exists('adonis.jpeg')

Complete example please go to this link

Thanks

Special thanks to the creator(s) of AdonisJS for creating such a great framework.

Keywords

FAQs

Package last updated on 12 Apr 2021

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc