Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

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

This function checks for a license.

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


JS.GetGlobalPropertyValue - JS.List