My aim is it to have code in a function node, which asks for the Node-RED runtime version number. Some of the following code within this function node should not be executed dependent on the version number.
This is important for me since I am working on two different versioned systems. My development system is version > 1.0.0 and my productive system is version < 1.0.0.
I found the Node-RED runtime API but I saw that the API is not available for the Node-RED editor.
How can I ask for the runtime version number inside a function node?
Edit 1: I found a possiblity to use environment variables. Is the version of Node-RED part of the environmant variables? Link. I am working with Linux Debian and Windows10.
let foo = env.get("FOO");
In 1.0, the node.done()
api was added to the Function node. You could use a test for its existence as a proxy for knowing if you are running in pre-1.0 or not.
if (!!node.done) {
// pre-1.0
} else {
// 1.0 or later
}