FCF 2.0 development in progress...
> > > >
[News] [Packages API] [Downloads] [Donate to the project] [Contacts]

fcf.require() function

fcf.Actions->array fcf.require(string a_module1, ..., string a_moduleN)
fcf.Actions->array fcf.require(string a_module1, ..., string a_moduleN, {quiet, async} a_options)
fcf.Actions->array fcf.require([string] a_modules)
fcf.Actions->array fcf.require([string] a_modules, {quiet, async} a_options)

Package: fcf-framework-core

File: fcf-framework-core:fcf.js

Available from version: 2.0.2

Performs module loading

For more information on loading and declaring modules, see "Modules" page

Arguments

string a_module1, ..., a_moduleN
- Module path in FCF notation

[string] a_modules
- Array of strings containing paths to modules in FCF notation

object a_options
- Object containing additional options
  • boolean quiet = false - If the parameter is equal to true, then the output of the module error message to the console is not displayed

  • boolean async = true - If the parameter is equal to true, then the loading of modules on the browser side is performed synchronously. To get the result synchronously, you need to call the result method of the returned fcf.Actions object

Result
fcf.Actions->array
- Returns a lazy object that will contain an array containing module data

Example: Asynchronous module loading

let [moduleData] = await fcf.require("module.js");

Example: Synchronous module loading

let [moduleData] = fcf.require("module.js", {async: false}).result();