I want to use the Function node to get a file path from settings. Is there an easy way to do this? As an example, I want to access userDir
.
There are multiple workarounds. I could write my own node that returns the setting value. I can add node-red to the global context like:
functionGlobalContext: {
RED:require('node-red')
}
At which point I can use context.global.RED.settings
But it seems like I am missing something... it shouldn't be that hard to grab the settings/determine what config values I am running with from the Function node.
No, the settings are not exposed to the Function node, only the values in the functionGlobalContext.
For the majority of users this is not needed, but if you can come up with a compelling use case post it to the mailing list and it will be considered as a feature request.
This has been discussed on the mailing list in the past so you may want to reference it in any future discussion.