If you have a look at the source code for node-red-contrib-uibuilder you will see some examples.
nodes/tilib.js is a generic helper module that can be required.
nodes/uiblib.js is more specific to uibuilder but is used in the same way.
nodes/socket.js and nodes/web.js are both singleton class modules (only a single instance of the class can ever be created). This provides a great way to isolate code & data but ensure that multiple instances of a node always shared the same instance of the class. In this case, processing for Socket.IO and ExpressJS respectively are encompassed by the modules & no matter how many uibuilder nodes you add to your flow, you will always share the same data.
Hi @Stwissel - so you should now have 2 solutions.
What I would like to say is if you intend on using this node only on new node-red installations (V1.3.x and above) then Nicks answer is the way to go. I would just like to add, if you do, it might be wise to specify the minimum node-red version in your package.json to avoid unnecessary bad feedback
Adam gave me the green light, signalling he would accept my pull request.
Reworked it to use the newish IBM SDK. Also split the nodes into individual files
for easier update. Made it work with IBM IAM....
and put structure in place to addd mocha test (in GitHub Actions they run nicely since I can run CouchDB side container automatically). Still some work to go....