Nodered flows.json comparator

Is there a way to compare flows.json by removing "x": and "y": coordinates?

Nodes might be moved in development and it generates unnecessary differences in comparator.

Right now I bookmark the lines with
image

and then remove those lines as it is described in here

Then I use Notepad++ Compare plugin to find differences.

But in the end I have to come back and align flows of .json with removed coordinates and original one

Is there a way to run a comparison with conditions?

1 Like

I don't have anything to add, but thank you for this. I've been looking for a way to compare them as well, and this is better than what I had.

After some time of searching and experimenting I stopped at WinMerge.

Another option from which I've started is:
BeyondCompare is a powerful tool which allows everything beyond my skills, also it is not free software.
But maybe it will help to somebody:

As for WinMerge:
https://alternativeto.net/software/winmerge/about/

image
after creating filters

it does everything I need for now

There is also Meld - http://meldmerge.org/
you can set a text filter like "[xy]":.* to ignore simple x y node placement changes if you like.

2 Likes

+1 for using BeyondCompare -- true, it's not free... but it's the best $40 I've ever spent on software!

I assume you've already enabled the "pretty: true" option in your settings.js file... that really helps avoid having to do any JSON re-formatting inside the comparison tool. Unfortunately, JSON does not allow newlines inside of strings, so long blocks of text found in function text, template body, and change node JSONata expressions all appear on 1 line.

To get around those limitations -- and to allow for fine-grained git change reporting -- there are several solutions I've seen over the years. I had even started my own file-based storageModule implementation that decomposes the flows into individual node "files", laid out in a tree according to the tab/group/node structure of my flows. I would have finished it by now, if I hadn't switched jobs recently... and no longer use node-red in my day job. However, I would still like to finish it and add it to the flows library as a plug-in, if there is wider interest.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.