Socket
Socket
Sign inDemoInstall

remotestorage-module-shares

Package Overview
Dependencies
0
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    remotestorage-module-shares

remoteStorage.js module for sharing images and other files


Version published
Weekly downloads
2
decreased by-50%
Maintainers
2
Install size
20.9 kB
Created
Weekly downloads
 

Readme

Source

npm

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
    • storeFile(mimeType, name, data)Promise
    • remove(name)Promise
    • list()Promise
    • getFileURL(name)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

ParamTypeDescription
mimeTypestringContent type of the file
namestringFilename
dataArrayBufferFile contents

Example

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

ParamTypeDescription
namestringThe 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

ParamTypeDescription
namestringthe filename

Keywords

FAQs

Last updated on 26 Jan 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc