Hey all,
Has anyone figured out how to edit the settings.js file for a Node-RED instance to include custom built-in functionalities — specifically to make globally accessible classes available in the function nodes?
I’m trying to find a clean way to add a custom class (with methods and styling logic) to the global context so I can use it across function nodes, with proper linting and IntelliSense.
For example:
ansify("Rainbow").bold.fg_rainbow
This works perfectly within the same function node where I define the StyledString class and the ansify() function. But once I try to use it elsewhere via global.get("ansify"), the runtime works — but I lose autocompletion and linting.
Here’s what I’d love to achieve:
- Load my custom class globally using
functionGlobalContextinsettings.js - Get full IntelliSense (as if it were a built-in class)
- Keep the chainable style (
.bold.fg_red.glitch, etc.) with autocomplete support across nodes
Eg.
this only work inside the same function node where i have defined the class
