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:
||The directory to store the
||The base directory under which context data is stored. Default:
||Whether to cache context in memory. Default:
||If caching is enabled, the minimum interval between writes to storage, in seconds. Default:
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.
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