Demonstrate how to require JavaScript in Personium Engine script.
You can now use require feature to do the heavy lifting.
Only 3 steps to add JS libraries and use it.
- Add two lines to the existing library file.
- Require it from your Engine Script.
- Use the library funtion like normal JS.
- For advance user, you can require recursively.
For exmple, Require personium.js which internally require underscore.js
I assume you already know how to deploy a service.
- Create a service in you Cell.
- Upload all the JavaScript files into the service folder.
- Configure test.js as the endpoint.
You can try out the CODEPEN or import the RestletClient.json to Restlet Client in Chome and execute the requests.
- Parameter validation
- Initialize Moment with timezone info
Without timezone, the date with become 9am in Japan. With timezone, the date is midnight as expected.