Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fh-wfm-simple-store

Package Overview
Dependencies
Maintainers
4
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fh-wfm-simple-store

A CRUDL storage engine that supports both in-memory and $fh.db backends.

  • 0.2.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
4
Weekly downloads
 
Created
Source

FeedHenry RainCatcher Simple Store

A CRUDL storage engine that supports both in-memory and $fh.db backends.

Usage

The initial config requires an entity name and the initial seed data:

const Store = require('fh-wfm-simple-store')({persistent: true});
const store = new Store('user');
store.init({ ... }).then(function() {
  // store is available for use
});

You can additionally utilize the listen method to have the story listen to conventially-named mediator topics.

const store = new Store('user');
store.init({}).then(function() {
  store.listen('', mediator);
  mediator.request('wfm:user:list').then(console.log);
  // the above pattern is also available through the `topics` property:
  store.topics.request('list').then(console.log);
})

Peristent Storage using the $fh.db API

The persistent storage functionality is provided by the $fh.db Cloud API. This API is provided by the RHMAP Platform to Cloud Applications.

You have the option to utilize an in-memory version of the store by passing a configuration of {persistent: false} when requiring this module, this store is intended for quick tests and will lose its contents on application restart.

The general configuration is done via the same environment variables that $fh.db regularly uses (see documentation link above).

During execution, you can detect if the storage engine being used utilizes a persistent backend via the {store}.isPersistent property.

Keywords

FAQs

Package last updated on 12 Apr 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc