Recent Changes - Search:

edit SideBar

Require

An accessor that requires a module that is not one of the Built-In JavaScript Modules should include a statement like

var foo = require('@accessors-modules/module-name');

at the top-level of the specification. This indicates to the accessor host that must have a locally installed implementation of the module in order to support this accessor. The host should reject the accessor if it does not have such an implementation installed.

If a module defines a function called moduleFunction, then the script can invoke that function as follows:

   var module = require('@accessors-modules/module-name');
   ...
   module.moduleFunction();

Modules should be defined according to the Module Specification.

TO DO: We need a module registry to avoid naming conflicts. Hosts should provide utilities like npm for installing modules.


Back to accessor specification

Edit - History - Print - Recent Changes - Search
Page last modified on June 08, 2017, at 03:02 AM