I’m back to this topic again. In the meanwhile I was able to implement my library, which does not use any external dependencies and is just working fine. I can call it from rules etc.
BUT, now, I’m trying to use and rewrite another node module (GitHub - Plustig/Android-Phone-Finder: Node.js app to automate google's find my device service; described here: Android Phone Finder from OpenHAB (Google Assistant and Alexa) - #3 by Plustig) which has external dependencies. The current implementation is not like a real node_module, what I can load and reference from rules. I want to have it in the same way as my lib, to be able to reference from rules.
Based on my minimal nodeJS knowledge, the code must be adjusted a little bit, an export must be created etc. Then it must be copied to OH and installed (so npm will install the dependencies). And here comes the problem. How? Where to put the module? Most probably I have to put into the same node_modules folders, but how can I install it?
My OH is running in a docker container …