New in 0.19
The Local Filesystem Context store holds context data in local files. By default it caches context data in memory, allowing both synchronous and asynchronous access.
If the caching mode is disabled, the store only supports asynchronous access.
To create a file store, the following configuration can be used.
The file store can take the following configuration options:
Options | Description |
---|---|
dir |
The directory to store the base directory in. Default: the user directory, ~/.node-red |
base |
The base directory under which context data is stored. Default: "context" |
cache |
Whether to cache context in memory. Default: true |
flushInterval |
If caching is enabled, the minimum interval between writes to storage, in seconds. Default: 30 |
The default configuration for a file
context store is to use the directory ~/.node-red/context
, with caching
enabled and writes to storage happening every 30 seconds.
The flushInterval
is provided to minimise wear on the underlying storage, such
as on a Raspberry Pi’s SD card. Note that if Node-RED is unexpectedly killed, any data
that has not yet been flushed will be lost.
This context store uses a separate file for each context scope. At the top level
is a directory for each flow scope and one for the global scope. Within each
flow scope directory is a file containing the flow scope, flow.json
and a file
for each node context.
$HOME/.node-red/context
├── global
│ └── global.json
├── <id of Flow 1>
│ ├── flow.json
│ ├── <id of Node a>.json
│ └── <id of Node b>.json
└── <id of Flow 2>
├── flow.json
├── <id of Node x>.json
└── <id of Node y>.json
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