2022.1

Table Of Contents
l The debug node displays the content of the msg object, which is passed between nodes
in a flow, in the debug message console. Add a debug node - one for each property of
the msg object - after another node to verify that the properties are changed as expected.
l The split node turns a single msg.payload consisting of an array into a series of
messages, each of which has a payload containing one of the array's elements. Note that
the Split node only works on msg.payload and not on its child objects.
l the ability to have multiple output channels in a Switch node and the fact that these
channels can be linked back to a node on the primary/main branch down stream.
These are some useful nodes created by third parties:
l The fs-ops-dir node (package: node-red-contrib-fs-ops) lists files in a directory.
l The watch-directory node captures incoming files. This node is preferable to the
standard watch node as the watch node may trigger the flow before a file is completely
written, which can become problematic when processing larger input files.
Reading a JSON file
In order to load a JSON file you can use a read file node. Set the Filename property to the full
path.
Note that when Node-RED's project feature is used, the path is relative to the project location
under NR's user directory (%userprofile%/.node-red/).
Example
When triggered, a startup flow must read the manifest.json file.
1. Add a read file node after the inject node that triggers the flow, and connect their ports.
2. Double-click the read file node to view its properties.
3. Paste or enter the full path to manifest.json in the Filename property. For example:
C:\projects\project-a\resources\manifest.json, or, when using Node-RED's project
feature: node-red\projects\project-a\manifest.json.
4. You can change the Name of the node, for example into: Read manifest.
5. Click Done.
Page 205