# Proposal for a new default settings file format

**URL:** <https://discourse.nodered.org/t/proposal-for-a-new-default-settings-file-format/88203>\
**Category:** Core Development\
**Created:** [23 May 2024 16:22 UTC](https://discourse.nodered.org/t/proposal-for-a-new-default-settings-file-format/88203 "2024-05-23T16:22:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 May 2024 16:22 UTC](https://discourse.nodered.org/t/proposal-for-a-new-default-settings-file-format/88203/1 "2024-05-23T16:22:49Z")

</div>

Slightly random thought that occurred to me today on a potential improvement to the default Node-RED settings file. Would appreciate any feedback.

> <https://github.com/node-red/node-red/issues/4719>
>
> Our current settings file is structured as a big Object:
> 
> \`\`\`
> module.exports …= {
> flowFile: 'flows.json',
> ...
> }
> \`\`\`
> 
> This is fine if you're used to working with objects - and that you remember to add a comma between any entries you add. This trips some users up and they end up with an invalid settings file. It's also a pain to have to add a comment about ensuring you add a comma whenever the docs talk about adding values.
> 
> I happened to be in the gitlab admin docs and noticed how they document their settings file:
> 
> \`\`\`
> gitlab\_rails\['some\_setting'\] = true
> gitlab\_rails\['some\_other\_setting'\] = {
> 'label' =\> 'hi',
> 'host' =\> 'example.com
> }
> \`\`\`
> Putting aside its ruby, not JavaScript - the key point is the settings are individual statements on a top level object.
> This removes the issues around getting the formatting right when adding new settings - whether a comma is needed or not.
> 
> 
> I propose changing our default settings file to be structured like this:
> 
> \`\`\`
> const settings = module.exports = {}
> 
> settings\['flowFile'\] = 'flows.json'
> 
> settings\['adminAuth'\] = {
> type: "credentials",
> ...
> }
> 
> \`\`\`
> 
> I'm in two minds whether to use dot notation (\`settings.flowFile\`) or bracket notation (\`settings\['flowFile'\]\`) - which is more accessible to non-JS users?
> 
> Raising this as an issue rather than jumping straight to PR to save the effort reformatting what we've got if this is a terrible idea.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [23 May 2024 18:59 UTC](https://discourse.nodered.org/t/proposal-for-a-new-default-settings-file-format/88203/2 "2024-05-23T18:59:24Z")

</div>

I've c\*\*\*d up my settings file more times than I care to remember whilst adding in updates, so any improvements to the format would very helpful.  
The [suggestion/comment](https://github.com/node-red/node-red/issues/4719#issuecomment-2127664340) by @Steve-Mcl sounds encouraging.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [22 July 2024 19:00 UTC](https://discourse.nodered.org/t/proposal-for-a-new-default-settings-file-format/88203/3 "2024-07-22T19:00:23Z")

</div>

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