Skip to content

dixonsiu/demo-personium-engine-require

Repository files navigation

Background

Demonstrate how to require JavaScript in Personium Engine script.

How to use the require feature

You can now use require feature to do the heavy lifting.
Only 3 steps to add JS libraries and use it.

  1. Add two lines to the existing library file.
  2. Require it from your Engine Script.
  3. Use the library funtion like normal JS.
  4. For advance user, you can require recursively.
    For exmple, Require personium.js which internally require underscore.js

How to deploy

I assume you already know how to deploy a service.

  1. Create a service in you Cell.
  2. Upload all the JavaScript files into the service folder.
  3. Configure test.js as the endpoint.

How to test

You can try out the CODEPEN or import the RestletClient.json to Restlet Client in Chome and execute the requests.

  1. Parameter validation
  2. Initialize Moment with timezone info
    Without timezone, the date with become 9am in Japan. With timezone, the date is midnight as expected.

Library version

  1. moment v2.22.1
  2. moment-timezone v0.5.14
  3. underscore v1.9.1

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published