Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raucao/remotestorage-module-shares
A remoteStorage data module for sharing files
https://github.com/raucao/remotestorage-module-shares
remotestorage remotestorage-module
Last synced: 2 months ago
JSON representation
A remoteStorage data module for sharing files
- Host: GitHub
- URL: https://github.com/raucao/remotestorage-module-shares
- Owner: raucao
- Created: 2017-05-26T18:03:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-26T19:41:16.000Z (almost 7 years ago)
- Last Synced: 2024-10-25T19:31:08.915Z (2 months ago)
- Topics: remotestorage, remotestorage-module
- Language: JavaScript
- Homepage: https://remotestoragejs.readthedocs.io/en/latest/data-modules.html
- Size: 78.1 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![npm](https://img.shields.io/npm/v/remotestorage-module-shares.svg)](https://www.npmjs.com/package/remotestorage-module-shares)
## 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) ⇒Promise
⏏
* [remove(name)](#exp_module_shares--remove) ⇒Promise
⏏
* [list()](#exp_module_shares--list) ⇒Promise
⏏
* [getFileURL(name)](#exp_module_shares--getFileURL) ⇒string
⏏### storeFile(mimeType, name, data) ⇒
Promise
⏏
Stores a shared file**Kind**: Exported function
**Returns**:Promise
- A promise, which will be fulfilled with the absolute
URL of the newly uploaded file (see )
**Access**: public| Param | Type | Description |
| --- | --- | --- |
| mimeType |string
| Content type of the file |
| name |string
| Filename |
| data |ArrayBuffer
| File contents |**Example**
```js
remoteStorage.shares.storeFile(mimeType, filename, content)
.then((url) => { console.log(`successfully stored file at ${url}`)
```### remove(name) ⇒
Promise
⏏
Remove a file**Kind**: Exported function
**Access**: public| Param | Type | Description |
| --- | --- | --- |
| name |string
| The filename |### list() ⇒
Promise
⏏
List all shared files**Kind**: Exported function
**Returns**:Promise
- Resolves with an array containing the filenames
**Access**: public### getFileURL(name) ⇒
string
⏏
Get the absolute URL of a file.**Kind**: Exported function
**Returns**:string
- The absolute URL of the file
**Access**: public| Param | Type | Description |
| --- | --- | --- |
| name |string
| the filename |