Source format of node-red project

saving node-red project with gitlab
currently node-red project is saved w/ one-line json string and it makes me hard to identify changed item using any of git client.
Is there anyway to save source as pretty json format ( w/ new line )?

nodered-prj-gitlab_|690x453

Thanks in advance!

Hi @sys4cad

yes, have a look for the flowFilePretty option in your settings file.

@knolleary thanks for your response.
Could you kindly pinpoint where can I find settings file?
I'm currently using nodered/node-red docker container.

./usr/src/node-red/node_modules/node-red/settings.js
//flowFilePretty: true,

./usr/src/node-red/node_modules/@node-red/runtime/lib/api/settings.js
if (runtime.settings.flowFilePretty) {
safeSettings.flowFilePretty = runtime.settings.flowFilePretty;

I found 2 candidates. :slight_smile:

The settings file is in /data within the container. We recommend you mount that as an external volume so you are able to update the container without losing your flows/settings - https://nodered.org/docs/getting-started/docker#managing-user-data

Thanks a million!

I've changed settings.js file in /data

// To enabled pretty-printing of the flow within the flow file, set the following // property to true: flowFilePretty: true,

and restarted the container, but saved flow in git still one line.
did I miss something?

Have you done a deploy since restarting?

greatly appreciated! it works now.
prettyJsonWorks

You might also like to see post 5 of this thread which coincidentally I posted only a few minutes ago which shows how you can also get a file with function nodes one line/line, which is useful for viewing diffs.

thanks a lot.

This topic was automatically closed after 60 days. New replies are no longer allowed.