Having to use a callback function to access nodes doesn't make logical sense, especially in an embedded environment.
I propose having two functions that I've been using for several years to overcome this shortfall. Depending on which environment you're working in, browser and/or backend (Node.JS).
RED.nodes.eachNode((callback) => ... );, why not just
RED.nodes.all();? That works for both browser and backend/Node.JS.
Also, for the Node.JS side,
RED.nodes.all().runtimeNode() (or whatever you want to call it) could be used to get the runtime node, instead of
This may seem like a small matter, but far too much time has been wasted trying to figure out why a callback is even needed to access an array of nodes, and I still don't know why, after 2 years. I've had to wrap the "eachNode" function, the call "getNode" for the runtime version.
Neither of those functions suggest what they offer, either. I don't care if we call them "editor nodes" vs "runtime nodes" or something completely different either, just so long as we have easy access to the nodes, and the functions we're calling to access them make sense as to what they are.
I'll help with the source code updates.