Table of Contents

Module Options

The modopts.ini configuration file (located in the Synchronet ctrl directory) is used for the configuration of various Synchronet JavaScript modules.

This file (and its corresponding load library: modopts.js) allows multiple modules to be configured in a single file rather than requiring a separate configuration file for each module that has configurable behavior. That said, it is only appropriate for simple enable/disable or option=value type configuration; modules requiring more complex configuration may still necessitate their own separate configuration files.


Each named section identifies the module which is being configured and the key=value pairs in that section are used to set configuration options for that module.

If you find that an expected section or key is not present in the file and you want to modify that section or key, just add it.


JavaScript module authors use the modopts.ini file by adding a single line to their .js file:

options=load(new Object, "modopts.js", "mymodule");

where “mymodule” is replaced with the JavaScript's module name (typically the module's main script filename, without the .js extension).

As a result of this line being executed, the options object is created with each key in the module's named section becoming a property of the options object with a value (Number, Bool, or String) containing the value portion of the key=value line.

Example modopts.ini section:


Options that need literal values should use a ':' like this:

which: \r\n\1-\1gWhich or \1h~Q\1n\1guit: \1h

Example module use of modopts in a fictional example module named “mymodule” (e.g. mymodule.js):

options=load(new Object, "modopts.js", "mymodule");
if(options && options.enable_cool_feature==true)

See Also

config/modopts.ini.txt · Last modified: 2022/03/14 19:48 by Andre
Back to top
CC Attribution 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0