cerus
Source:
Access:
public

This is the core cerus class. This "function" will return an object with some functions pre-added to it. This object can be seen as the CerusJS core. When adding plugins to cerus they are added to this abject. For this functionality two functions have been pre-added to the object .plugins() and .use(). Both help you with managing the plugins. For more information about plugins you can read the tutorial about it.

Summary

Name
Description
Returns the plugin managing class.
use
Adds a new plugin to the core.

Functions

.plugins()
Access:
public
Summary:
Returns the plugin managing class.

This function returns the plugin managing class. With this class you can not only add, but also remove, list, clear, etc. your plugins.

Returns

Type
Class
Description
The plugins class.
.use(plugin)
Access:
public
Summary:
Adds a new plugin to the core.

With this function you can easily add a new plugin to the core. It is basically a shortcut for .plugins().add(). This means this plugin will check and then add the plugin, exactly the same as .plugins().add(). For more information about adding plugins, see {@link plugins.add}.

Parameters

Name
Type
Description
plugin
Object
The plugin object that contains the plugin that will be added.

Examples

// in this example a plugin is added to the cerus core
// plugin -> {
//   name: "example",
//   dependencies: []
// }
cerus.use(plugin);
// -> will add the plugin to the cerus core