If you want to know which node modules you have installed, the answer is in the ~/.node-red/.config.json
file.
So we can easily grab that data and summarise it using the marvelous JSONata:
payload.nodes {
"TOTAL": $count($keys($)),
"node_modules": $keys($)
}
Below is an example flow. Note the example has two file read's to illustrate Linux and Windows file paths. You will need to adjust the file paths to suit your own installation.
This JSONata will give you a list of objects where each object contains the name of the module and a list of the node names for that module.
(
$each(payload.nodes,function($v, $k) {
{
"name": $k,
"nodes": $keys($v.nodes)
}
});
)
Which gives output that looks like this (I've removed the node-red module as it is long):
[
{
"name": "node-red-node-twitter",
"nodes": [
"twitter"
]
},
{
"name": "node-red-contrib-uibuilder",
"nodes": [
"uibuilder"
]
}
]
Or, more compactly:
$each(payload.nodes,function($v, $k) {
{$k: $keys($v.nodes)}
})
which gives:
[
...
{
"node-red-node-google": [
"google plus",
"google places",
"google-api-config",
"google geocoding",
"google directions",
"google calendar"
]
},
{
"node-red-contrib-blockly": [
"blockly"
]
},
...
]
A more compact alternative would be:
$sort(payload.nodes.*.nodes.(
$each($, function($v, $k) {
$k & " : " & $v.module
})
))
Gives a list of nodes sorted by node name and each node shows the module it comes from.
[
...
"file : node-red",
"function : node-red",
"google calendar : node-red-node-google",
"google directions : node-red-node-google",
"google geocoding : node-red-node-google",
"google places : node-red-node-google",
"google plus : node-red-node-google",
"google-api-config : node-red-node-google",
"httpin : node-red",
"httprequest : node-red",
"humanizer : node-red-contrib-moment",
...
]
Totallyinformation,
I know where the “settings.js” file is but I cannot find the “config.json” file called out in your published flow path.