# sand-google-storage

> Fetch / Upload images to google cloud storage

Latest version **2.0.0** (published 2017-05-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install sand-google-storage
pnpm add sand-google-storage
yarn add sand-google-storage
bun add sand-google-storage
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2017-05-10 |
| First published | 2016-09-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 14 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Kevin Smithson |
| Maintainers | ksmithson |
| Keywords | google, gcloud, storage |

## Links

- npm: https://www.npmjs.com/package/sand-google-storage
- npm.io page: https://npm.io/package/sand-google-storage

## Dependencies (14)

- [once](https://npm.io/package/once.md) ^1.4.0
- [async](https://npm.io/package/async.md) ^2.0.1
- [arrify](https://npm.io/package/arrify.md) ^1.0.1
- [lodash](https://npm.io/package/lodash.md) ^4.15.0
- [pumpify](https://npm.io/package/pumpify.md) ^1.3.5
- [request](https://npm.io/package/request.md) ^2.74.0
- [through2](https://npm.io/package/through2.md) ^2.0.1
- [duplexify](https://npm.io/package/duplexify.md) ^3.4.5
- [sand-grain](https://npm.io/package/sand-grain.md) ^1.1.1
- [event-stream](https://npm.io/package/event-stream.md) ^3.3.4
- [concat-stream](https://npm.io/package/concat-stream.md) ^1.5.2
- [stream-events](https://npm.io/package/stream-events.md) ^1.0.1
- [google-auto-auth](https://npm.io/package/google-auto-auth.md) ^0.2.4
- [gcs-resumable-upload](https://npm.io/package/gcs-resumable-upload.md) ^0.7.3

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2017-05-10
- 1.1.2 — 2017-02-02
- 1.1.1 — 2017-02-02
- 1.1.0 — 2016-10-06
- 1.0.4 — 2016-09-29
- 1.0.3 — 2016-09-28
- 1.0.2 — 2016-09-28
- 1.0.1 — 2016-09-27
- 1.0.0 — 2016-09-13

## README

# Google Storage Sand Grain

### Config

| name | description |
| ---- | ----------- |
| bucket | The name of the main bucket |
| tmpBucket | The name of the temporary bucket |

### Usage
```js
const storage = require('sand-googled-storage');

new Sand()
	.use(storage)
	.start();
```

```js
// 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](https://cloud.google.com/storage/docs/json_api/v1/objects/list)

#### deleteFile(path)
Delete file at path in current bucket

#### delete()
Delete the current file in the current bucket

---
_Source: https://npm.io/package/sand-google-storage · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
