A custom Node-RED node for exploring JavaScript objects from msg, flow, and global context.
It helps users inspect nested data, discover available variables, return keys, values, or both, and prepare results for later logic or dropdown-style UI usage.
- GitHub: https://github.com/omidteimoori/node-red-object-explorer
- npm: https://www.npmjs.com/package/@omidteimoori/node-red-object-explorer
- Package name:
@omidteimoori/node-red-object-explorer
- Explore objects from:
msgflowglobal
- Resolve nested paths such as:
payloadpayload.fieldsvariables.devices[0].topicsitems[0].name
- Return:
- direct keys
- deep keys
- direct values
- deep values
- key/value pairs
- matching keys
- matching values
- matching key/value pairs
- Search by partial or exact key/path match
- Support arrays and nested objects
- Safe handling for missing paths,
null,undefined, and circular references - Optional second output for diagnostics
Install the package in the Node-RED user directory:
cd ~/.node-red
npm install @omidteimoori/node-red-object-explorerThen restart Node-RED and refresh the editor.
- Node-RED:
>=3.0.0 - Node.js:
>=16.0.0
- Open the Node-RED editor
- Drag the object explorer node into a flow
- Choose the source:
msgflowglobal
- Enter the path to explore
- Choose the mode
- Choose the output format
- Optionally enter a search term
The package includes a small example flow in the examples folder. In Node-RED, open the import menu and look under the Examples section for Basic Object Exploration.
direct_keysReturns the immediate child keys of the selected objectdeep_keysReturns all nested keys below the selected objectdirect_valuesReturns the immediate child valuesdeep_valuesReturns all nested valueskey_value_pairsReturns keys and values togethermatching_keysReturns keys or paths that match the search termmatching_valuesReturns values under matching keysmatching_key_value_pairsReturns matching paths, keys, and values together
The node writes the main result to msg.payload.
It also sets:
msg.countmsg.sourcePathmsg.searchTermmsg.mode
Main result data.
Diagnostic status data for:
- success
- no-match
- error cases
This can be useful for debug panels, status handling, or logging.
- Source:
msg - Path:
payload - Mode:
direct_keys
Example result:
[
"device1",
"device2"
]- Source:
msg - Path:
payload - Mode:
deep_values
- Source:
msg - Path:
payload - Mode:
matching_values - Search:
packet - Recursive:
true - Exact match:
true
Example result:
[
{
"packet1": 1,
"packet2": 2
},
{
"packetX1": "Y1",
"packetX2": "Y2"
}
]- Source:
msg - Path:
payload.fields - Mode:
deep_keys - Output:
dropdown_options - Selected item:
path
Example result:
[
{
"label": "msg.payload.fields.temperature.value",
"value": "msg.payload.fields.temperature.value"
},
{
"label": "msg.payload.fields.temperature.updatedAt",
"value": "msg.payload.fields.temperature.updatedAt"
}
]- The node is designed to help users explore unknown or deeply nested structures without writing repeated Function node code.
- If a path does not exist, the node does not crash. It sends a diagnostic message to the second output.
- Arrays are supported when
Include arraysis enabled.
Developed by Omid Teimoori
MIT License