# remotestorage-module-shares

> remoteStorage.js module for sharing images and other files

Latest version **2.1.4** (published 2018-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install remotestorage-module-shares
pnpm add remotestorage-module-shares
yarn add remotestorage-module-shares
bun add remotestorage-module-shares
```

## 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.1.4 |
| Published | 2018-01-26 |
| First published | 2017-05-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sebastian Kippe |
| Maintainers | galfert, skddc |
| Keywords | remotestorage, remotestorage-module |

## Links

- npm: https://www.npmjs.com/package/remotestorage-module-shares
- Repository: https://github.com/skddc/remotestorage-module-shares
- Homepage: https://github.com/skddc/remotestorage-module-shares#readme
- Issues: https://github.com/skddc/remotestorage-module-shares/issues
- npm.io page: https://npm.io/package/remotestorage-module-shares

## 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.1.4 (latest) — 2018-01-26
- 2.1.3 — 2018-01-05
- 2.1.2 — 2017-11-02
- 2.1.1 — 2017-11-01
- 2.1.0 — 2017-11-01
- 2.0.0 — 2017-08-11
- 1.0.1 — 2017-05-29
- 1.0.0 — 2017-05-29

## README

[![npm](https://img.shields.io/npm/v/remotestorage-module-shares.svg)](https://www.npmjs.com/package/remotestorage-module-shares)

<a name="module_shares"></a>

## shares
A remoteStorage data module for sharing of files.

All shares are stored with a timestamp prefix. For images, thumbnails are
created and stored in a subdirectory.


* [shares](#module_shares)
    * [storeFile(mimeType, name, data)](#exp_module_shares--storeFile) ⇒ <code>Promise</code> ⏏
    * [remove(name)](#exp_module_shares--remove) ⇒ <code>Promise</code> ⏏
    * [list()](#exp_module_shares--list) ⇒ <code>Promise</code> ⏏
    * [getFileURL(name)](#exp_module_shares--getFileURL) ⇒ <code>string</code> ⏏

<a name="exp_module_shares--storeFile"></a>

### storeFile(mimeType, name, data) ⇒ <code>Promise</code> ⏏
Stores a shared file

**Kind**: Exported function  
**Returns**: <code>Promise</code> - A promise, which will be fulfilled with the absolute
                   URL of the newly uploaded file (see <getFileURL>)  
**Access**: public  

| Param | Type | Description |
| --- | --- | --- |
| mimeType | <code>string</code> | Content type of the file |
| name | <code>string</code> | Filename |
| data | <code>ArrayBuffer</code> | File contents |

**Example**  
```js
remoteStorage.shares.storeFile(mimeType, filename, content)
  .then((url) => { console.log(`successfully stored file at ${url}`)
```
<a name="exp_module_shares--remove"></a>

### remove(name) ⇒ <code>Promise</code> ⏏
Remove a file

**Kind**: Exported function  
**Access**: public  

| Param | Type | Description |
| --- | --- | --- |
| name | <code>string</code> | The filename |

<a name="exp_module_shares--list"></a>

### list() ⇒ <code>Promise</code> ⏏
List all shared files

**Kind**: Exported function  
**Returns**: <code>Promise</code> - Resolves with an array containing the filenames  
**Access**: public  
<a name="exp_module_shares--getFileURL"></a>

### getFileURL(name) ⇒ <code>string</code> ⏏
Get the absolute URL of a file.

**Kind**: Exported function  
**Returns**: <code>string</code> - The absolute URL of the file  
**Access**: public  

| Param | Type | Description |
| --- | --- | --- |
| name | <code>string</code> | the filename |

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