# Installed node names in exported flow and info panel

**URL:** <https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925>\
**Category:** Feature Requests\
**Created:** [12 October 2018 10:12 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925 "2018-10-12T10:12:22Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 October 2018 10:12 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/1 "2018-10-12T10:12:22Z")

</div>

It would often be helpful when attempting to offer support for users if an exported flow included the name of the installed node for each node in the flow (node-red-contrib-whatever for example). Maybe this is not even technically possible, I don't know.

In fact even for myself it would sometimes be useful if the info panel for a node included that information.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 October 2018 13:31 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/2 "2018-10-12T13:31:53Z")

</div>

This might indeed be useful.

As a workaround, have you seen the flow that analyses you flow file for node use? It tells you how many nodes of each type you have in use in your flow.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 October 2018 13:45 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/3 "2018-10-12T13:45:51Z")

</div>

> [@TotallyInformation](#):
>
> As a workaround, have you seen the flow that analyses you flow file for node use

Do you mean [1]? I don't think that provides the installed node type does it? Just the short type that appears in the flow file. For instance there are several contrib pid nodes that all have the type pid. It is not possible to tell from the flow which one it is.

[1] [https://flows.nodered.org/node/node-red-contrib-flow-statistics](https://flows.nodered.org/node/node-red-contrib-flow-statistics)

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [12 October 2018 14:23 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/4 "2018-10-12T14:23:26Z")

</div>

> [@Colin](#):
>
> Do you mean [1]? I don't think that provides the installed node type does it? Just the short type that appears in the flow file.
> 
> [1] [https://flows.nodered.org/node/node-red-contrib-flow-statistics](https://flows.nodered.org/node/node-red-contrib-flow-statistics)

Correct! the short type.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [12 October 2018 16:10 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/5 "2018-10-12T16:10:22Z")

</div>

Am I right in thinking that the information @Colin wants is not available in the flow file? It seems that one would need to use whatever mechanism the editor employs to link node instances to their source files.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 October 2018 16:29 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/6 "2018-10-12T16:29:32Z")

</div>

Yes, that is why I am not sure if it even possible.

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [12 October 2018 16:54 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/7 "2018-10-12T16:54:34Z")

</div>

There is a function `RED.nodes.getNodeList()` that seems to return a list of all available nodes but I don't know whether it is public.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 October 2018 23:35 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/8 "2018-10-12T23:35:00Z")

</div>

I did the analysis with a flow but it is the same as the node. mostly, it is fairly easy to get the node module from the node name. But it isn't fully automatic.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 October 2018 10:03 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/9 "2018-10-13T10:03:24Z")

</div>

> [@cflurin](#):
>
> There is a function `RED.nodes.getNodeList()` that seems to return a list of all available nodes but I don't know whether it is public.

When I try to use RED.nodes in a function node it is undefined.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 October 2018 10:05 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/10 "2018-10-13T10:05:13Z")

</div>

> [@TotallyInformation](#):
>
> it is fairly easy to get the node module from the node name

How does one do that? By interrogating the files in the node\_modules folder, or is there an alternative?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [13 October 2018 10:43 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/11 "2018-10-13T10:43:46Z")

</div>

> [@Colin](#):
>
> > it is fairly easy to get the node module from the node name
> 
> How does one do that? By interrogating the files in the node\_modules folder, or is there an alternative?

You are over thinking - Try the manual method. 🙂

Clearly though, the Node-RED "Manage Palette" capability is able to work this out as it displays nodes under their module. So you could dig into the source code for that and see how it does it.

You might start here:

> <https://github.com/node-red/node-red/blob/549e56e2204a48639cb60fe2e83e847910d23125/editor/js/ui/palette-editor.js#L193>

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 October 2018 12:33 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/12 "2018-10-13T12:33:41Z")

</div>

> [@TotallyInformation](#):
>
> Clearly though, the Node-RED "Manage Palette" capability is able to work this out as it displays nodes under their module

Good point.  
I notice also that the file `.config.json` includes this information.

It would be interesting to hear from the node-RED Powers that Be what they think of the idea of showing the node's parent in the info tab. Also the idea of including it in the flow file and/or exported flows.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [13 October 2018 13:59 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/13 "2018-10-13T13:59:20Z")

</div>

> [@Colin](#):
>
> I notice also that the file `.config.json` includes this information.

Ah! I'd missed that! Of course, the data is all there. Now we just need to hack through some JSONata to pull it together. Shouldn't be too hard actually. Firing up the dev environment now ....

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [13 October 2018 14:17 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/14 "2018-10-13T14:17:36Z")

</div>

> [@TotallyInformation](#):
>
> > I notice also that the file `.config.json` includes this information.
> 
> Ah! I'd missed that! Of course, the data is all there. Now we just need to hack through some JSONata to pull it together. Shouldn't be too hard actually. Firing up the dev environment now ....

OK, done. Sorry it took so long, had to go deal with the washing 😄

Here is the JSONata we need:

```auto
payload.nodes {
    "TOTAL": $count($keys($)),
    "node_modules": $keys($)
}

```

And here 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.

```auto
[{"id":"57f9f3a.e32620c","type":"file in","z":"d480ffdb.73b02","name":"","filename":"/home/pi//node/nrlive/.data/.config.json","format":"utf8","chunk":false,"sendError":false,"x":470,"y":1040,"wires":[["d1d4a711.9a25d8"]]},{"id":"d1d4a711.9a25d8","type":"json","z":"d480ffdb.73b02","name":"","pretty":false,"x":690,"y":1040,"wires":[["e1bdf411.316238"]]},{"id":"e1bdf411.316238","type":"change","z":"d480ffdb.73b02","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.nodes {\t \"TOTAL\": $count($keys($)),\t \"node_modules\": $keys($)\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":1040,"wires":[["1a0235f0.8c486a"]]},{"id":"1a0235f0.8c486a","type":"debug","z":"d480ffdb.73b02","name":"","active":true,"console":"false","complete":"false","x":1050,"y":1040,"wires":[]},{"id":"b6c696f6.b0bbe8","type":"inject","z":"d480ffdb.73b02","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":240,"y":1040,"wires":[["57f9f3a.e32620c","62b31849.ce3328"]]},{"id":"bae74244.be8fa","type":"comment","z":"d480ffdb.73b02","name":"How Many Node modules in my configuration?","info":"","x":350,"y":1000,"wires":[]},{"id":"62b31849.ce3328","type":"file in","z":"d480ffdb.73b02","name":"","filename":"C:\\src\\nr\\data\\.config.json","format":"utf8","chunk":false,"sendError":false,"x":430,"y":1080,"wires":[["d1d4a711.9a25d8"]]}]

```

Trivial in the end.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [13 October 2018 14:21 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/15 "2018-10-13T14:21:46Z")

</div>

And added to the flows site for reference:

[https://flows.nodered.org/flow/eb29b1a45c044706009d2ef47e59f51f](https://flows.nodered.org/flow/eb29b1a45c044706009d2ef47e59f51f)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 October 2018 14:45 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/16 "2018-10-13T14:45:21Z")

</div>

Whilst useful if one wants a list of installed nodes, it does not tell one which installed node a particular node on the flow comes from, which is principally what I am after.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [13 October 2018 14:49 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/17 "2018-10-13T14:49:06Z")

</div>

> [@Colin](#):
>
> Whilst useful if one wants a list of installed nodes, it does not tell one which installed node a particular node on the flow comes from, which is principally what I am after.

That is a slightly harder JSONata query that I haven't quite got my head around.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 October 2018 14:59 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/18 "2018-10-13T14:59:05Z")

</div>

> [@TotallyInformation](#):
>
> That is a slightly harder JSONata query that I haven't quite got my head around.

Isn't the problem linking it into the editor somehow so it can be shown in the info tab or something?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [13 October 2018 15:10 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/19 "2018-10-13T15:10:42Z")

</div>

> [@Colin](#):
>
> Isn't the problem linking it into the editor somehow so it can be shown in the info tab or something

Well, depends what you ultimately want to do with the information. Just use a debug as I have and that will show it just fine. Or dump to a Dashboard, save to file - whatever really, Node-RED's your oyster (or something like that).

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 October 2018 15:20 UTC](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925/20 "2018-10-13T15:20:51Z")

</div>

One of my main reasons for asking for this is for the regular situation we have here when someone says, for example, that they have a modbus problem and it can be like getting the proverbial blood from the stone to find out which modbus node they are using. If we could just tell them to look on the info tab of the node, or possibly even better, if the parent node name was included in the exported flow, then it might be rather easier.

If the name were included in an exported flow then on import one would be able immediately to determine which nodes were required to run the flow.

[Next page](https://discourse.nodered.org/t/installed-node-names-in-exported-flow-and-info-panel/3925.md?page=2)
