Expose Node.js globals to function node

Is there a policy on which of the Node.js globals are exposed to the function node?

I'd personally like to use the URL and URLSearchParams objects which are exposed globally in Node.js v10 onwards.

I could make a PR for this (adding to the sandbox object here +tests would suffice I guess?)

you could add them to the global context in settings.js then they would be available in the function node. See the "Global context" section of https://nodered.org/docs/user-guide/writing-functions

Thanks, that's what I'm currently using.

It makes sense though to match the Node.js behavior by adding to the Buffer, timeout/interval functions etc. that are already exposed. It would improve a teeny bit on the learning curve and time-to-fresh-setup. However, it's not much so I get why it might as well stay as-is.

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