In the above example, Node.js is enabled by including the
nodejs_enabled:true entry in the associative array that is passed during creation of the roHtmlWidget instance.
Loading BrightSign Modules
require() function (i.e.
require("@brightsign/<module_name>")). BrightSign modules are actually part of the firmware, but in terms of usage, they are identical to other Node.js modules.
Synchronous and Asynchronous Methods
BrightSign modules contain both synchronous and asynchronous methods. Synchronous methods return an object that can be used immediately, while asynchronous methods return a Promise object, which will itself return the object data when the operation is resolved. Scripts must handle these delayed returns (typically using the
.catch() methods available on the Promise object).