(0.20) env.get added to Function node
knolleary opened this issue · 2 comments
In Node-RED 0.20, we're adding a new function to the Function node that provides access to environment variables:
let foo = env.get('MY_ENV_VAR');
This will also be used at a later date to access Subflow Instance properties and Project Settings - but for now only accesses env vars.
The commit adding this to the dev
branch is here: node-red/node-red@0c5a76b
Nodegen will need to be updated to support this. I believe it could be added today - it is backward compatible.
Design note on using env vars - https://github.com/node-red/node-red/wiki/Design:-Using-environment-variables
@knolleary Thank you for the detail information. Once @HiroyasuNishiyama merged the pull request #86, I'm going to implement the function. I also added it into our roadmap.
@knolleary I updated the function node template in the commit, 17d2982. Sorry for the late response.