🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

sand-google-storage

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sand-google-storage

Fetch / Upload images to google cloud storage

latest
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

Google Storage Sand Grain

Config

namedescription
bucketThe name of the main bucket
tmpBucketThe name of the temporary bucket

Usage

const storage = require('sand-googled-storage');

new Sand()
	.use(storage)
	.start();
// Read a file from google storage
sand.storage.bucket().file('myFile.jpg').createReadStream();

// Write a file to google storage
sand.storage.bucket().file('myFile.jpg').createWriteStream();

Methods

Sand Grain

Methods that are attached to sand.storage

storage()

Returns a new Storage Object

bucket(name)

Set the bucket or use the default set in the config. Returns a new Storage Object

tmpBucket(name)

Set the tmp bucket or use the default set in the config. Returns a new Storage Object

file(path)

Set the file path to a file for uploading or reading. Returns a new Storaged Object

Storage

Methods that are on the Storage Object

createReadStream()

Returns a new read stream to download file

createWriteStream()

Returns a new write stream to upload file

download(options)

Download a file into memory or a file with passed in options.destination

deleteFiles()

Delete Files that matched query Some Options

deleteFile(path)

Delete file at path in current bucket

delete()

Delete the current file in the current bucket

Keywords

google

FAQs

Package last updated on 10 May 2017

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