Socket
Socket
Sign inDemoInstall

wf_storage

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

wf_storage

Storage Utilities


Version published
Maintainers
1
Weekly downloads
2
increased by100%

Weekly downloads

Readme

Source

A module that manages file storage

Supported storage engines

AWS S3 storage

Allows to store files in AWS S3 buckets.

Options:

var storageConfig = {
  s3: {
    s3Options: {
      accessKeyId: process.env.AWS_S3_ACCESS_KEY,
      secretAccessKey: process.env.AWS_S3_ACCESS_KEY_SECRET,
      region: process.env.AWS_S3_REGION
    },
    bucket: "my-files"
  }
}
require('wf-storage')(mediator, storageConfig);

Gridfs MongoDB storage

Allows to store file in MongoDB database using Gridfs driver

Options:

var storageConfig = {
  gridFs: {
    mongoUrl: "mongodb://localhost:27017/files"
  }
};
require('wf-storage')(mediator, storageConfig);

Topic Subscriptions

Topics are used in file module.

Description

Saves file to the storage

Example
var parameters = {
   // File namespace (folder)
   namespace:null,
   fileName:"test",
   location: "/tmp/file"
  //Optional topic unique identifier
  topicUid: "uniquetopicid"
}

mediator.publish("mm:files-store:create", parameters);
Description

Retrieve file from the storage (BinaryStream)

Example
var parameters = {
  namespace:null,
  fileName:"test",
  topicUid: "uniquetopicid"
}

mediator.publish("mm:files-store:get", parameters);

FAQs

Last updated on 13 Apr 2022

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