Accessors run in a JavaScript host that provides a standard set of functions and modules that enable the accessor to interact with devices and services.
- Index of functions for quick reference.
- Action Functions: A set of functions that an accessor may define that are invoked by the host to execute a swarmlet. The swarmlet host will always invoke these in such a way that the variable
this
is the accessor itself, which defines the functions such as input
- Top-Level JavaScript Functions: These functions enable the accessor to get inputs and produce outputs. They also provide a small set of basic mechanisms that are commonly found in a JavaScript environment.
- Built-In JavaScript Modules: All accessor hosts are required to support all built-in modules. Modules conform with the CommonJS Module Specification.
- Optional JavaScript Modules: More sophisticated capabilities that may or may not be supported by a particular accessor host. These modules must also conform with the CommonJS Module Specification.
- JSDoc, auto-generated code documentation.