Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 10.4   10.5   11.0   11.1   11.2   11.3   11.4   11.5   12.0   12.1    Statistic    FMM    Blog  

JS.InitModules

Installs Duktape module loading.

Component Version macOS Windows Linux Server iOS SDK
JavaScript 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "JS.InitModules"; JSRef )   More

Parameters

Parameter Description Example
JSRef The JavaScript reference number. $js

Result

Returns OK or error.

Description

Installs Duktape module loading.
Only calls JS.InitModules once on a new instance of the JavaScript engine.
Define your own Duktape.modSearch() to provide environment specific module lookups.
After these steps, require() will be registered to the global object and the module system is ready to use.

Examples

Create JavaScript environment and enable modules:

Set Variable [ $$JS ; Value: MBS("JS.New") ]
# enables require() to use Duktape.modSearch
Set Variable [ $r ; Value: MBS( "JS.InitModules"; $$js) ]

See also

Release notes

Example Databases

Blog Entries

Created 24th March 2021, last changed 13th June 2021


JS.GetGlobalPropertyValue - JS.List

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins

Start Chat