Page 1 of 1

Javascript Module Development Questions

Posted: 24 Aug 2015 23:52
by memny
I'm starting to play with writing user modules for the RaZberry and I have a few questions about the process:

* Modules placed in the userModules won't be overwritten when updating the server software?

* Is there an easier way for the server to recognize changes to the module other than restarting the z-way service?

* Are all files added to the automation/lib directory added to the server/context? Specifically I want to add moment.js

* I'm new to 'embedded' javascript and I'm having some problems understanding http.request(). I understand that z-way uses V8. Is http.request available as part of V8 or is it added somewhere else? Is there any documentation available for it?

* Do you think it would be safe to use node.js to run tests on my code on my development machine before deploying it to the server?

Thanks in advance!

Re: Javascript Module Development Questions

Posted: 29 Aug 2015 03:25
by PoltoS
- userModules folder is preserved on update
- no, module is loaded in the JS engine on start
- no, you need to explicitly do executeFile()
- http is an add-on to V8 written by us based on curl library. all docs is in zwayDev.pdf on razberry.z-wave.me
- up to you