Javascript Module Development Questions

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
memny
Posts: 1
Joined: 24 Aug 2015 22:43

Javascript Module Development Questions

Post 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!
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

Re: Javascript Module Development Questions

Post 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
Post Reply