New in 0.19
The Context Store API provides a pluggable way to configure where context data is stored.
By default, Node-RED uses a memory-based implementation of this API. It also provides a file-based implementation.
To create a custom Context Store, a module should be created that implements the Store Module API.
The contextStorage
property in settings.js can be used to configure context storage.
It is an object with one or more named context store configurations.
Each context store configuration consists of two parts; a module
property and a config
property.
The module
property identifies the context store plugin to use. It can either be
the name of built-in module (currently either memory
or localfilesystem
), or it should be
a module that has been loaded using require
.
The config
property is an object that is passed to the module to provide an
custom options.
A custom plugin’s module must export a single constructor function. This function is called when a
new instance of the plugin is required. The function is passed the value of the config
property for the given instance. This allows the runtime to have multiple instances
of the same store plugin, each with its own configuration.
The object returned by the constructor function must implement all of the functions detailed here.
Node-RED: Low-code programming for event-driven applications.
Copyright OpenJS Foundation and Node-RED contributors. All rights reserved. The OpenJS Foundation has registered trademarks and uses trademarks. For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy and Trademark List. Trademarks and logos not indicated on the list of OpenJS Foundation trademarks are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
The OpenJS Foundation | Terms of Use | Privacy Policy | OpenJS Foundation Bylaws | Trademark Policy | Trademark List | Cookie Policy